aspose file tools
The moose likes IDEs, Version Control and other tools and the fly likes How to pass -source 1.4 argument in Eclipse Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Engineering » IDEs, Version Control and other tools
Reply Bookmark "How to pass -source 1.4 argument in Eclipse" Watch "How to pass -source 1.4 argument in Eclipse" New topic
Author

How to pass -source 1.4 argument in Eclipse

Bharat Roy
Ranch Hand

Joined: Jul 01, 2004
Posts: 156
I want to use "assertion" using Eclipse but don't know where to pass -source 1.4 argument. Kindly help.
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 14491
    
    7

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.


Customer surveys are for companies who didn't pay proper attention to begin with.
Bharat Roy
Ranch Hand

Joined: Jul 01, 2004
Posts: 156
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

Joined: Nov 24, 2005
Posts: 14672
    
  11

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.


[My Blog]
All roads lead to JavaRanch
Bharat Roy
Ranch Hand

Joined: Jul 01, 2004
Posts: 156
Thanks Satou, it worked
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: How to pass -source 1.4 argument in Eclipse
 
Similar Threads
eclipse, ant, and Java versions
Program with assert does not compile
Can I run Tiger on Mantis ?
Passing compiler arguments in Eclipse
reading string from a Writer object