I am not a Java program but after a bit of trial and error I managed to get a J-Link application compiled, here are the details.
Currently I have only managed to run programs compiled with JDK 6 available at the Java Archive Downloads. However the programs do seem to run using JRE 7, see Creo J-Link Running Program, for details on how to run an application.
I initially used the command line to compile the .java files. Here is the batch file that resided in source directory.
"C:\Program Files\Java\jdk1.6.0_45\bin\javac" *.java -classpath "C:\Program Files\PTC\Creo 2.0\Common Files\M070\text\java\pfc.jar" pause
I am using a 64bit machinem so am using the 64bit jdk, you will have to change the paths to
pfc.jar depending on your creo version.
IntelliJ IDEA and Eclipse Luna
After having success with compiling with the command line, I decided to switch to an IDE; I managed to get programs compiling with IntelliJ IDEA and Eclipse Luna. The important step is to ensure they were using JDK 6 for compiling. I ended up using IDEA, but the different was marginal.