|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|
|Mac mini Java Installation Error||Dekema2||Mac mini||4||Feb 10, 2014 02:43 PM|
|-fobjc-arc is not supported error and duplicate symbol error in compiling||mehdies||Mac Programming||3||Sep 24, 2013 02:57 AM|
|Java error||Appl3FTW||MacBook Pro||3||Aug 21, 2013 07:53 PM|
|java security error only when a box is checked||Corrosive vinyl||Mac Applications and Mac App Store||0||Jun 6, 2013 11:07 AM|
|General: How-to-Fix TinyUmbrella Java Error 5.11.00 and above.||SmartiOS||Jailbreaks and iOS Hacks||1||Oct 20, 2012 05:15 AM|
All times are GMT -5. The time now is 06:24 PM.