Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to pass -source 1.4 argument in Eclipse

 
Bharat Roy
Ranch Hand
Posts: 156
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want to use "assertion" using Eclipse but don't know where to pass -source 1.4 argument. Kindly help.
 
Tim Holloway
Saloon Keeper
Pie
Posts: 18094
48
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's done on your Project. Select Preferences/Java Compiler and set Source Compatibility to 1.4 (or higher).

There's also a hyperlink there to set preferences for the entire workspace.
 
Bharat Roy
Ranch Hand
Posts: 156
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Tim, thanks for the reply but its not working.

The Eclipse editor is complaining, "Syntax error on token assert" - which is not possible as it is getting compiled and run using notepad and command line.

I checked as you said and the default for the project is Java 1.4 version.

BTW I am using Eclipse 3.1.1 if that helps.
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Did you check the compliance option ?

Window->Preferences->Java->Compiler->Compliance and Classfiles

Unchech "Use default compliance settings", and set the "source compatiblitiy" to 1.4.
 
Bharat Roy
Ranch Hand
Posts: 156
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Satou, it worked
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic