I have written a assertion program, but i am unable to run it, it compiled successfully when i gave the javac -source 1.4 .... But for running the program i am not able to find ea or enableassertions option under java command,
Assertions have been included only since Java 1.4 To use them you'll have to upgrade your JDK to 1.4 (I'd suggest 5.0, though). Make sure your JAVA_HOME environmental variable points to your java_5.0 directory, and PATH environmental variable - to java_5.0/bin directory.
Joined: Aug 03, 2002
Originally posted by Animesh Shrivastava: When i do a java -version, i get java 1.3.1_01 and something related to Hotspot jvm and all
So you were able to compile with javac -source 1.4 but java -version shows 1.3.1_01. So that implies that you have the directory containing the early version of the JRE in your PATH variable. So you will have to edit your PATH variable so that only the directory containing the binaries from JRE 1.4 can be found.
I had the same when I first installed J2SDK 1.4. The installer (in some builds at least, maybe in all) forgets to replace java and javaw in the Windows installation directory. As the path to that takes precedense over anything you put on the path yourself the older java and javaw get taken instead of the newly installed ones even if your path settings are correct. Remove java.exe and javaw.exe from your windows installation directories and everything is probably just AOK.