Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » class file has wrong version 51.0,should be 49.0
class file has wrong version 51.0,should be 49.0 [message #1703552] Mon, 03 August 2015 04:16 Go to next message
frank ho is currently offline frank hoFriend
Messages: 5
Registered: June 2015
Junior Member
Dear All,

I have 2 jdk in my computer, one is 1.7 and another is 1.5. I got a eclipse from my co-worker, checkout project from svn, complied it successful. However, there is error : class file has wrong version 51.0,should be 49.0 when I run it in eclipse( this is google gwt project).

One of my colleague said I should modify one cache file under the eclipse direcotry, but he forgot the loaction of this file.

Anyone knows?
Re: class file has wrong version 51.0,should be 49.0 [message #1703591 is a reply to message #1703552] Mon, 03 August 2015 12:56 Go to previous messageGo to next message
Erick Hagstrom is currently offline Erick HagstromFriend
Messages: 107
Registered: April 2014
Location: USA
Senior Member
Your class file was compiled under Java 1.7. You're running it with Java 1.5. That doesn't work. You either need to recompile it with Java 1.5 or run it with Java 1.7. See https://en.wikipedia.org/wiki/Java_class_file#General_layout (refer to byte offset 6 & 7 in the table) for more information.
Re: class file has wrong version 51.0,should be 49.0 [message #1703824 is a reply to message #1703591] Wed, 05 August 2015 08:46 Go to previous messageGo to next message
frank ho is currently offline frank hoFriend
Messages: 5
Registered: June 2015
Junior Member
After modified this file : org.eclipse.jdt.launching.prefs under : <project folder>\.metadata\.plugins\org.eclipse.core.runtime\.settings, this problem has been fixed. The modification is : add
<libraryLocations>\r\n<libraryLocation 
jreJar\="D\:/Java/jdk7/jre/lib/resources.jar" 
jreJavadoc\="http\://docs.oracle.com/javase/7/docs/api/" 
jreSrc\="D\:/Java/jdk7/src.zip" pkgRoot\=""/>\r\n

to it.

But my questions are :

1. what is this file used for?
2. when use this file?
3. why I have to add these information to it by hand rather than generate these automatically when I set jdk in eclipse preference?
4. why this error occur if this file doesn't has <libraryLocations> when running project(the project compile success before running)?
Re: class file has wrong version 51.0,should be 49.0 [message #1703826 is a reply to message #1703591] Wed, 05 August 2015 08:47 Go to previous message
frank ho is currently offline frank hoFriend
Messages: 5
Registered: June 2015
Junior Member
After modified this file : org.eclipse.jdt.launching.prefs under : <project folder>\.metadata\.plugins\org.eclipse.core.runtime\.settings,

this problem has been fixed.

The modification is :
add
<libraryLocations>\r\n<libraryLocation 
jreJar\="D\:/Java/jdk7/jre/lib/resources.jar" 
jreJavadoc\="http\://docs.oracle.com/javase/7/docs/api/" 
jreSrc\="D\:/Java/jdk7/src.zip" pkgRoot\=""/>\r\n.........

to it.

eclipse is :
Eclipse Java EE IDE for Web Developers.

Version: Luna Release (4.4.0)
Build id: 20140612-0600


my questions are :

1. what is this file used for?
2. when use this file?
3. why I have to add these information to it by hand rather than generate these automatically when I set jdk in eclipse preference?
4. why this error occur if this file doesn't has <libraryLocations> when running project(the project compile success before running)?

[Updated on: Fri, 07 August 2015 03:00]

Report message to a moderator

Previous Topic:Export Desktop project
Next Topic:Nested project support
Goto Forum:
  


Current Time: Wed Dec 04 09:44:06 GMT 2024

Powered by FUDForum. Page generated in 0.03469 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top