Java Notes
Java Development Kit (JDK)
[an error occurred while processing this directive]The most popular Java compiler is Sun's Software Development Kit (JDK) (aka the Software Development Kit (SDK)). It's free, and does a good job. The only problem is that the compiler is only a compiler - there is no editor and no graphical user interface. It is typically used in one of the following ways.
- From the DOS command window with the
javaccommand. - With a program editor (eg, TextPad) which has an interface to the compiler.
- With an IDE (Integrated Development Environment). See IDEs.
Free Download
Download only the J2SE JDK from java.sun.com. There are three editions - get the "standard edition". Sun has major problems getting the names right, so this is still called Java 2 some places altho it is Java 5 in others.
- J2SE - Java 2 Standard Edition - You want this.
- Not J2ME - Java 2 Micro Edition - This is for phones, PDAs, etc.
- Not J2EE - Java 2 Enterprise Edition - You don't want this unless you're doing Java client server programming, and even then, you probably don't need it.
- [an error occurred while processing this directive] Not JRE - Java Runtime Environment - This will automatically be installed when you install the JDK.
If you're a Macintosh user, it might already be installed on your system. Look at Java for Mac OS X.
Installation
Installing the JDK is easy (at least in Windows). Just follow the prompts.
CLASSPATH
If you're using commands from the DOS command window, you will probably have to set CLASSPATH. See CLASSPATH.
JVM runtime -enableassertions (-ea) option
| Command | Effect |
|---|---|
java MyProg | Assert statements are removed by class loader. |
java -enableassertions MyProg | Assert statements are executed. |
java -ea MyProg | Short form for allowing assertions. |
It's also possible to enable/disable assertion checking at runtime for individual classes or for library routines, but that level of control is not useful for most purposes.















