|Apr 9, 2007, 09:32 PM||#1|
java assertion compiling error
I am trying to compile an example for java from THE REALLY BIG INDEX:
However whenever I try to compile:
I get the following error:
"warning: as of release 1.4, assert is a keyword, and may not be used as an identifier"
And if I try to compile it with enable assertions I get:
javac: invalid flag: -ea
Usage: javac <options> <source files>
Any ideas on how to get this code to compile? I am running Java version 1.4.2_12, which I believe should be able to handle assertions. Thanks for your help.
|Apr 9, 2007, 11:58 PM||#2|
Warning messages aren't fatal. If that's all you saw, then the compile was probably successful. Do you see a Card.class in that directory? If so, then you don't need to do anything about the warning.
Also, while I didn't actually try this (nor have I ever used assertions in Java), it looks like you add the '-ea' flag when running your program, not when compiling it. Like this:
java -ea Card
|Thread Tools||Search this Thread|
|thread||Thread Starter||Forum||Replies||Last Post|
|Library path errors after Apple software update.||Alan S||MacBook Pro||1||Aug 22, 2011 09:11 PM|
|compiling error -f68881||higeorge||Mac Programming||2||Nov 16, 2010 02:31 PM|
|compile error when compiling objective c on windows||srinivas.be88||MacBook Pro||0||Aug 18, 2010 02:41 AM|
|Maddening Java Compiler Error (StdIn)||j.drake.hoffman||Mac Programming||5||Aug 20, 2009 03:19 PM|
|Java Homework - Compilation Error||mcmacmcmac||Mac Programming||2||Oct 30, 2007 12:06 PM|
All times are GMT -5. The time now is 08:52 PM.