This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes Java version problem in eclipse Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Java version problem in eclipse" Watch "Java version problem in eclipse" New topic
Author

Java version problem in eclipse

Aniruddh Joshi
Ranch Hand

Joined: Jul 29, 2008
Posts: 275

Hi All,

I am facing a problem while using annotations .When I write the following code:


eclipse IDE shows syntax error :annotaions are only available if source level is 5.0

In my project build path, the JRE used is jre1.6.01 and the problem persists with jdk1.5 as well.
My JAVA_HOME is set to jdk1.5

I have faced the bad class file problem(version 48 required but class is vern 49/50) with weblogic 8.1 before and I resolved it by using jdk 1.4 throughout. But this is a different project.

Please let me know if you know the cause of the problem and the workaround.


Anrd
"One of the best things you could do is to simplify a larger application into a smaller one by reducing its process and complexity - Fowler"
Sunil Kumar
Ranch Hand

Joined: Apr 24, 2007
Posts: 76
The java version of eclipse is independent of system variables (system java version). Hence you need to configure your project source at Java 5 in eclipse


Sunil Kumar
http://goodtoknowit.blogspot.com/
Aniruddh Joshi
Ranch Hand

Joined: Jul 29, 2008
Posts: 275

I have done it ..as I have written in the original post
Sunil Kumar
Ranch Hand

Joined: Apr 24, 2007
Posts: 76
If you can cross check - Thats done through Project > Properties > Java Compiler > Enable Project specific settings and choose the appropriate Compiler Compliance level
[ December 29, 2008: Message edited by: Sunil Kumar ]
Aniruddh Joshi
Ranch Hand

Joined: Jul 29, 2008
Posts: 275

it worked, thanks Sunil
Sunil Kumar
Ranch Hand

Joined: Apr 24, 2007
Posts: 76
Welcome!!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Java version problem in eclipse