Installing Java on Windows
|
If you are comfortable inspecting your system for an existing Java runtime, and installing it if necessary, then go ahead and do so now.
We strongly recommend the full JDK from Sun/Oracle, as it contains the server-mode JVM, but Mailismus will function perfectly well with the standalone JRE, albeit that only contains the client-mode JVM, which may not perform as optimally.
Mailismus requires Java version 1.6.
If you're wondering what a Java is, then don't give up now, the installation is quite simple!
First some terminology:
• JVM = Java Virtual Machine: The VM, or Virtual Machine, is the runtime component that executes Java code, akin to .NET's CLR.
• JRE = Java Runtime Environment: This is the basic Java installable, and incorporates the JVM, plus some other essential components.
• JDK = Java Development Kit: This is the Java development toolset, and it incorporates the JRE plus the tools required for Java development (compiler, javadoc, etc).
• Java EE = Java Enterprise Edition: This incorporates the JDK, plus application servers and heavyweight web development apps - completely unnecessary for our purposes.
NB: The JDK is also known as Java SE (Java Standard Edition).
It might seem from the above that you therefore want the JRE if you're only going to run a Java program, but as alluded to above, Java for Windows is actually packaged with 2 VMs, a client-oriented one that's included with the JRE, and a sever-oriented one that ships with the JDK.
The Client JVM starts up quicker, at the cost of doing less optimisation, and is intended to support web apps that might only fire up for a split second.
The Server VM does more thorough code compilation and optimisation, and at the cost of barely a second of extra startup time, it should perform much better over the lifetime of a long-running server process.
So you want to install the JDK ...
- Check If Already Installed:
Bring up the list of installed programs from your Control Panel, and look for Java.
The JRE and JDK are latterly listed as separate packages, eg. if both are present you might see entries like
Java 6 Update 21 and
Java SE Development Kit 6 Update 21, which constitute the JRE and JDK respectively.
Under the Java naming scheme, that version can also be referred to JDK6u21.
If the JDK shows up as already installed, skip to step 3.
- Install:
To install Java, go to the Oracle (formerly Sun)
download site
and scroll down to the basic Java VM (ie. not Java EE or any bundles, just to keep things simple), which is known as
Java SE
(or Standard Edition),
and click on the JDK option rather than the JRE (the JDK incorporates the JRE).
The Java download is a standard Windows executable, so just follow the on-screen instructions.
If you accept all prompts, the canonical install path is
C:\Program Files\Java, under which you should end up with
jre6 and
jdk1.6.0_21 subdirectories.
The exact pathnames will obviously vary as new Java releases follow, but the former represents the standalone JRE (which contains a client-mode JVM) and the latter is the JDK. The JDK also contains its own JRE, but this one has a server-mode JVM.
- Set JAVA_HOME Environment Variable:
Right-click on Computer to bring up System Properties (may require one or two intermediate dialogues or screens to get there, depending on your version of Windows), and from there bring up the Environment Variables (probably under 'Advanced' tab).
Check if JAVA_HOME exists among the System or User variables, and if not create a new one.
It needs to point at the JDK installation directory, so based on our running example, this would be:
C:\Program Files\Java\jdk1.6.0_21.
- Validate Installation:
Launch a DOS console window (START => Run => cmd) and enter:
"%JAVA_HOME%"\bin\java -server -version
This will verify that you have correctly set up the JAVA_HOME environment variable to point at the required server VM.
If all is well, that concludes the Java install.
Note that if the JAVA_HOME variable pointed at the standalone JRE
(eg. C:\Program Files\Java\jre6)
rather than the JDK's JRE, then the java
command would fail to recognise the -server
option, and it should be omitted.