Preamble
This page contains instructions for installing the Sun Java Development Kit (JDK) for Windows and Linux/UNIX.
Please refer to our [Supported Platforms] topic for details on the Sun JDK versions which are supported for Confluence.
| Mac OS X users can ignore these instructions because this operating system already comes pre-installed with a JDK. |
Linux Installation
Distribution-Specific Installation Guide
The installation guide below is generic. For more detailed information or easier procedures for installing Java on your Linux platform, you can refer to the following table :
Generic Installation Guide of the Sun JDK on Linux
- Create the JDK installation directory :
- Copy the JDK binary in this directory :
- Move into the JDK installation directory :
By default, the downloaded binary can't be executed. You must give it the executions rights :
- Launch the installer :
(Press the space bar many times to go to the end of the licence contract and type yes then press the enter key).
- Remove all the installation binaries :
- You then need to create 2 more directories (if they are not automatically created) :
| You must now have three directories :
- default : a symbolic link on the JDK version run by default
- jdk1.6.0_18 : the version of the JDK we've just installed
- latest : a symbolic link on the latest JDK version available on the machine
|
- You must now declare the alternatives for some executables as java, javac, ...
| You can copy-paste the above lines in a text file and then run the script in root mode. |
- You must now choose an alternative to the default java configuration :
- Check the java version
- Set the JAVA_HOME environment variable for all users. At the end of the file /etc/profile/, add the following lines :
- Done
Windows Installation
Installing Sun JDK
- If you are not sure whether you have Sun's JDK installed correctly, please confirm by doing the following :
- Run a complete directory search (using the 'All File and Folders' option if available) on your drives for the occurrence of 'jdk' in the filename.
- If your results retrieve a folder with the name 'jdk' immediately followed by a series of version numbers (for example, jdk1.6.0_13), then your Sun JDK has been installed. You should double-check the contents of this folder to ensure that the installation files are intact. If you are unsure about this, proceed to step 2 to re-install the Sun JDK. Otherwise, proceed to step 3 to check that your JAVA_HOME environment variable has been set correctly.
- If you do not retrieve a result like this, then it is highly likely that your Sun JDK has not been installed.
- To install the Sun JDK, follow these instructions :
- Go to the Java Sun download page.
- Download the version entitled 'JDK 6 Update XX', where 'XX' stands for some number. (Sun will provide the latest version on that page.)
- When the download has finished, run the Java installer. At one point, you will be asked to choose a directory to install to. Copy or write this directory down for use later.
- Check that the JAVA_HOME environment variable has been set correctly.
- Open the 'Start' menu, choose 'Run', type cmd in the 'Run' dialog box and click the 'OK' button.
- In the command prompt window, type echo %JAVA_HOME% and then press Enter.
- View the result :
- If a directory path is display that looks similar to one of the following examples, with the letters 'jdk' immediately preceding a series of version numbers, and this path matches the location where you installed the Sun JDK in step 2, then your Sun JDK has been successfully installed and your JAVA_HOME environment variable has been set correctly.
Examples of typical JAVA_HOME environment variable values :
- C:\Program Files\Java\jdk1.6.0_13
- C:\Progra~1\Java\jdk1.6.0_13
- C:\Java\jdk1.6.0_13
- C:\jdk1.6.0_13
- If nothing is displayed or you do not see 'jdk' immediately followed by a series of version numbers (like one of the examples above), then you need to set the JAVA_HOME environment variable. Please follow the instructions below to set your JAVA_HOME environment variable to the directory you where you have just installed the JDK. By default, this directory is under C:\Program Files\Java.
- Done
| Note Sometimes, Windows make a copy of the java executables in the C:\Windows\System32 directory. If theses are present, these are the one who are run by default. |
Setting the JAVA_HOME Variable in Windows
Locate the JDK Installation Directory
If you already know the installation path for the Java or Software Development Kit, go to Stage 2 below. Otherwise, find the installation path by following these instructions :
- Unless you changed the installation path for the Java Development Kit during installation, it will be in a directory under C:\Program Files\Java. Using Explorer, open the directory C:\Program Files\Java.
- Inside that path will be one or more subdirectories such as jdk1.6.0_13. If you have just installed the Java Development Kit, it will be installed to the newest directory, which you can find by sorting by date. For example, it may be installed in C:\Program Files\Java\jdk1.6.0_13. This is the installation path.
Set the JAVA_HOME Variable
Once you have identified the JDK installation path :
- Right-click the My Computer icon on your desktop and select 'Properties'.
- Click the 'Advanced' tab.
- Click the 'Environment Variables' button.
- Under 'System Variables', click 'New'.
- Enter the variable name as JAVA_HOME.
- Enter the variable value as the installation path for the Java Development Kit.
- Click 'OK'.
- Click 'Apply Changes'.
|
No contributors found for: authors on selected page(s)
|