0

I try to deploy a simple "Hello Word" in my local server GlasshFish 3, but at the deploy the console print this message

[#|2013-01-15T15:00:02.458+0100|SEVERE|glassfish3.1.2|
javax.enterprise.system.tools.admin.org.Exception while deploying the app
[HelloWorldEJB] :UnsupportedClassVersionError: Class ejb_other.PlaceAuctionItemBean 
as unsupported major or minor version numbers, which are greater than those found 
in the Java Runtime Environment version 1.6.0_27|#]

My JAVA_HOME has java version 1.6.0_27 (it refers to _C:\Program Files\Java\jdk1.6.0_27_), my Eclipse (indigo) project refers to java 1.6.0_27. I think (i don't know how to verify) that GlasshFish refers to JAVA_HOME.

In my PC (Windows 7) I found 2 directory having java.exe:

  • C:\Windows\SysWOW64>java -version -->>java version "1.6.0_29"
  • C:\Windows\System32>java -version -->>java version "1.6.0_27"

I found more discussions about this exception (f.e. this or this ), but I need of something more specific for Eclipse/Glasshfish, because I can't to solve. I see that the JVM is the same for compilation and execution.

Post Scriptim

I add the screenshot about the places where I declare JVM: it's always 1.6. one:compiler two:build path eclipse three:envieronment variables

Where can I see that I compile with java 7 or it runs with another JVM?

Community
  • 1
  • 1
alepuzio
  • 1,382
  • 2
  • 28
  • 38
  • solution: http://stackoverflow.com/questions/2540548/how-do-i-get-eclipse-to-use-a-different-compiler-version-for-java. I had'nt found this answer before. Sorry :( – alepuzio Jan 16 '13 at 09:24

2 Answers2

0

ejb_other.PlaceAuctionItemBean was obviously compiled for Java 7 which won't work if you run it in a Java 6 JVM.

Marcel Stör
  • 22,695
  • 19
  • 92
  • 198
  • ok, I added screenshot where I se that I compile with Java 6. Where am I wrong? – alepuzio Jan 15 '13 at 15:19
  • solution: http://stackoverflow.com/questions/2540548/how-do-i-get-eclipse-to-use-a-different-compiler-version-for-java. Maybe my question is a duplicate... – alepuzio Jan 16 '13 at 10:23
0

Found solution

There's another place where setting the compiler's options:

how do I get eclipse to use a different compiler version for Java?

Community
  • 1
  • 1
alepuzio
  • 1,382
  • 2
  • 28
  • 38