I have a very simple application. Here is the entire source code:
import java.io.BufferedWriter;
import java.io.FileWriter;
import java.text.SimpleDateFormat;
import java.util.Date;
public class AppTest {
public static void main(String[] args) {
Date myDate = new Date();
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
String myDateString = sdf.format(myDate);
FileWriter fstream = null;
BufferedWriter out = null;
try{
fstream = new FileWriter("AppTest.log",true);
out = new BufferedWriter(fstream);
out.append(myDateString + " AppTest has run\n");
out.close();
fstream.close();
}catch (Exception e){}
}
}
It will run on operating systems other than Mac OS X. It will run on Mac OS X if I force the use of Java 6. This can be done from the command line:
/System/Library/Java/Support/Deploy.bundle/Contents/MacOS/javaws -XstartOnFirstThread http://forexhitandrun.com/app_dev/apptest.jnlp
In this case, it writes one line to the log file so I know it has run.
But if I run it as a webstart app from the browser like so:
http://forexhitandrun.com/app_dev/apptest.jnlp
Nothing gets written to the log file. This method uses the most recent update of Java 7 from Oracle.
But before we jump to the conclusion that it is my Java installation that is at fault, I can launch a different app from the browser (therefore Java 7) and it does work:
http://www.cadc-ccda.hia-iha.nrc-cnrc.gc.ca/JavaTest/
Has anyone experienced something similar, or does anyone have any clues about what might be wrong?