class file has wrong file version 51.0, should be 49.0

272 views
Skip to first unread message

frank ho

unread,
Jun 17, 2015, 8:35:34 AM6/17/15
to google-we...@googlegroups.com
my environment is :
<pre>
windows 7, 32 bit, two jdk, one is 1.5, another is 1.7, google gwt, jetty, ant, two eclipse, one is kepler, another is luna.
</pre>

for kepler, I set its jdk is 1.5, and use ant to compile and jar, this works, and eclipse can open the gwt window when debugging.

then i use luna, check out project(gwt project) from cvs, there is error said the jdk is 1.5 when compiling with ant, therefore I changed the jdk to 1.7 since this project requires this version, eventually compile is ok with ant.  However, when I debug it in eclipse, it opens a gwt window said unable to compile to jsp, and the error in console is : 

<pre>
10:20:48.193 [btpool0-8] ERROR org.apache.jasper.compiler.Compiler - Javac exception

Compile failed; see the compiler error output for details.

    at org.apache.tools.ant.taskdefs.Javac.compile(Javac.java:933)
    at org.apache.tools.ant.taskdefs.Javac.execute(Javac.java:757)
    at org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:382)
    at org.apache.jasper.compiler.Compiler.compile(Compiler.java:472)
    at org.apache.jasper.compiler.Compiler.compile(Compiler.java:451)
    at org.apache.jasper.compiler.Compiler.compile(Compiler.java:439)  
   
.....
10:20:48.194 [btpool0-8] ERROR org.apache.jasper.compiler.Compiler - Env: Compile:

javaFileName=/C:/Users/FRANKH~1/AppData/Local/Temp/Jetty_localhost_8001_www__Login__-wcglsc/jsp//org/apache/jsp\login_jsp.java
   
cannot access cn.com.yict.easyport.web.service.CommonUtil

wrong class file: D:\cvs\eInvoice\common-web\target\classes\cn\com\yict\easyport\web\service\CommonUtil.class

class file has wrong version 51.0, should be 49.0

please delete this file or make sure ...

import cn.com.yict.easyport.web.service.CommonUtil;
</pre>

what happened?

Thanks in advance!

Jens

unread,
Jun 17, 2015, 8:43:59 AM6/17/15
to google-we...@googlegroups.com
Looks like you have class files compiled with Java 1.7 but you still launch your common-web project using Java 1.5 which then does not understand classes compiled for Java 1.7.

-- J.

frank ho

unread,
Jun 18, 2015, 8:09:29 AM6/18/15
to google-we...@googlegroups.com
Thanks Jens!  

Yes, it did as you said.  I just cannot understand why because I have changed the jdk to 1.7 both in windows -> preference and project build path.

what I am missing?

Jens

unread,
Jun 18, 2015, 9:07:22 AM6/18/15
to google-we...@googlegroups.com

what I am missing?

Maven should also use Java 1.7 for compilation, not just the IDE. I would guess Maven uses the JAVA_HOME environment variable which might still point to Java 5.

-- J.
 

frank ho

unread,
Jul 24, 2015, 10:12:36 PM7/24/15
to Google Web Toolkit, jens.ne...@gmail.com
I didn't use Maven.

Thomas Broyer

unread,
Jul 25, 2015, 5:21:45 AM7/25/15
to Google Web Toolkit, frank...@gmail.com, frank...@gmail.com


On Wednesday, June 17, 2015 at 2:35:34 PM UTC+2, frank ho wrote:
my environment is :
<pre>
windows 7, 32 bit, two jdk, one is 1.5, another is 1.7, google gwt, jetty, ant, two eclipse, one is kepler, another is luna.
</pre>

for kepler, I set its jdk is 1.5, and use ant to compile and jar, this works, and eclipse can open the gwt window when debugging.

then i use luna, check out project(gwt project) from cvs, there is error said the jdk is 1.5 when compiling with ant, therefore I changed the jdk to 1.7 since this project requires this version, eventually compile is ok with ant.  However, when I debug it in eclipse, it opens a gwt window said unable to compile to jsp, and the error in console is : 

<pre>
10:20:48.193 [btpool0-8] ERROR org.apache.jasper.compiler.Compiler - Javac exception

Compile failed; see the compiler error output for details.

    at org.apache.tools.ant.taskdefs.Javac.compile(Javac.java:933)
    at org.apache.tools.ant.taskdefs.Javac.execute(Javac.java:757)
    at org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:382)
    at org.apache.jasper.compiler.Compiler.compile(Compiler.java:472)
    at org.apache.jasper.compiler.Compiler.compile(Compiler.java:451)
    at org.apache.jasper.compiler.Compiler.compile(Compiler.java:439)  
   
.....
10:20:48.194 [btpool0-8] ERROR org.apache.jasper.compiler.Compiler - Env: Compile:

javaFileName=/C:/Users/FRANKH~1/AppData/Local/Temp/Jetty_localhost_8001_www__Login__-wcglsc/jsp//org/apache/jsp\login_jsp.java

This looks like Eclipse WTP, not GWT-related.
Looks like Jetty is spawn in a 1.5 JVM rather than 1.7.
Reply all
Reply to author
Forward
0 new messages