Quick help -- Unresolved compilation problem:

Hi there, I followed step by step the visual guide for setting up jME with eclipse. Then I try to test the Helloworld.java program (src/jme.TutorialGuide) the following message appears on the console.

Exception in thread "main" java.lang.Error: Unresolved compilation problem:

Syntax error, annotations are only available if source level is 5.0

at com.jme.app.SimpleGame.<init>(SimpleGame.java:103)

at jmetest.TutorialGuide.HelloWorld.<init>(HelloWorld.java:46)

at jmetest.TutorialGuide.HelloWorld.main(HelloWorld.java:48)

Which JDK did you use to compile with?

If you used anything less than 1.5 (aka jdk 5) then you'll need to dl at least jdk 1.5.

There is code in jme that uses annotations and those annotations can not be referenced inside of code compiled with less than jdk 1.5

I use jdk1.6.0 , this seems strange… I had a system restoration issue two days ago, do you think that's to consider?

maybe set compliance level in preferences>Java>Compilier to 5.0 ?

I also have the same problem .

I have tried using from Java 1.5 to java 1.6.1…

I downloaded jme today. I am using eclipse as my IDE. is there something I am missing?

I also realised that some jar files might be missing when I compared to the instructions provided for the installation. This are the jar files that I have

  1. jinput.jar
  2. jogg-0.0.7.jar
  3. jorbis-0.0.15.jar
  4. junit-4.1.jar
  5. lwjgl.jar
  6. lwjgl-fmod3.jar
  7. lwjgl-util-applet.jar

    The following are missing

    lwjgl-applet.jar , lwjgl-test.jar ,  lwjgl-util.jar

    Is this something new or do I need them and they are missing in the distribution?


One thing to be aware of, is that eclipse doesn't use the compiler from the JDK (at least by default). It has a built-in compiler, which can be either 1.4 or 1.5 compliant. The code you compile will be run using the JVM you have installed though. So probably you are best off installing the newest 1.6 JDK (or JRE), making sure that you are actually using it to run eclipse (you can set a -vm option on the command line, or just check by running "java -version" in a command window), making sure that eclipse has this JRE set as the default (In eclipse, "Window" menu, then Preferences…, then Java on the left, then Installed JREs, make sure you have an entry for the right JRE, and that it is ticked.), then setting compliance to "5.0" under Java->Compiler in the same dialog.

If it doesn't work after all that… no idea :wink:

Thank you very  much

setting compliance to "5.0" under Java->Compiler in the same dialog solved the problem. I had the eclipse default to 1.4


Thank you Shingoki! That worked.  :wink: