Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » -source 1.4 option
-source 1.4 option [message #298562] Tue, 31 January 2006 19:16 Go to next message
Eclipse UserFriend
Originally posted by: candypang.hotmail.com

I would like to start using the new java 1.4 function "assert".
( http://java.sun.com/j2se/1.4.2/docs/guide/lang/assert.html#c ompiling)

However, in order to do so, the option "-source 1.4"
must be specified for the class compiler:
javac -source 1.4 MyClass.java

How can I specify such an option in Eclipse?

Thank you very mucy.
Candy
Re: -source 1.4 option [message #298564 is a reply to message #298562] Tue, 31 January 2006 20:13 Go to previous messageGo to next message
Eclipse UserFriend
Main Menu
Window->Preferences
Java->Compiler
Source compatibility
1.4 (or higher)

Pat McNerthney
ClearPoint Metrics, Inc.
Re: -source 1.4 option [message #298598 is a reply to message #298564] Wed, 01 February 2006 10:42 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: candypang.hotmail.com

Thanks, I have tried.
But a single line:
assert true;

will give me the following error in Eclipse:
Syntax error on token "assert",
AssignmentOperator expected after this token.

Another suggestion?
Thanks again.
Candy
Re: -source 1.4 option [message #298604 is a reply to message #298598] Wed, 01 February 2006 11:03 Go to previous messageGo to next message
Eclipse UserFriend
Try to set "Compiler compliance level", "Generated .class file
compatibility" and "source compatibility" to 1.4. This works for me.

Ricky
Re: -source 1.4 option [message #298624 is a reply to message #298604] Wed, 01 February 2006 15:04 Go to previous message
Eclipse UserFriend
Originally posted by: candypang.hotmail.com

Thanks Ricky,
It works.
Candy 8)
Previous Topic:Problem with getting file path relative to the project in the workspace
Next Topic:JavaHeapSpace Eclipse problems
Goto Forum:
  


Current Time: Tue Jul 01 13:39:26 EDT 2025

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

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

Back to the top