Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Java version problem in eclipse

 
Aniruddh Joshi
Ranch Hand
Posts: 275
Eclipse IDE jQuery Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Sunil Kumar
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Aniruddh Joshi
Ranch Hand
Posts: 275
Eclipse IDE jQuery Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have done it ..as I have written in the original post
 
Sunil Kumar
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 275
Eclipse IDE jQuery Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
it worked, thanks Sunil
 
Sunil Kumar
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome!!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic