Page 1 of 1

compiling jdk1.4

Posted: Wed Jan 21, 2004 11:14 am
by saxenaanshul
hi plz guide me as to how u can compile jdk1.4 program codes in textpad.
i am encountering this problem becoz some of the reserved words in jdk1.4 like "assert" are not being recognized in textpad.
if this is not possible then plz guide as to what tool should be used in order to compile it

Posted: Wed Jan 21, 2004 11:20 am
by s_reynisson
Not sure if I understand you, but setting up the JDK is explained here:
http://textpad.com/support/faq/java.html
Also I found this using search for "assert"
http://textpad.com/forum/viewtopic.php?t=4668
but there's no feedback on it so I'm not sure about that one.
HTH

Posted: Wed Jan 21, 2004 11:26 am
by saxenaanshul
hi,
i know abt installing textpad for jdk.
i wanted to know whether textpad can be used to compile jdk1.4 codes which has new reserved words like "assert".if yes then how

Posted: Wed Jan 21, 2004 11:38 am
by s_reynisson
Via Google I found:
To enable assertions one must set source="1.4", "1.5" or later in <javac> when the source is being compiled, and that the code must contain assert statements to be tested.
and also http://leepoint.net/notes-java/20langua ... usage.html
And since this is a compiler option use

Code: Select all

javac -source 1.4 MyProg.java
So, referring to my first reply, add -source 1.4 to your parameters in Textpad.
To run your programs you must also enable it

Code: Select all

java -enableassertions MyProg
Add -enableassertions to your parameters in Textpad.