This is the WSO2 Data Services Server documentation version 2.6.3

Installing Java Development Kit (JDK) on Linux

The WSO2 Data Services Server is a Java application. Therefore, in order to install the Data Services Server, it is necessary to install Java Development Kit first on the computer. Then you need to set the environment variables.

Note

See DSS Installation Prerequisites for the full list of all applications necessary to install and work with WSO2 DSS.

Note:
Change the version numbers according to your installation.

Follow the instructions below to install Java Development Kit on Linux using command line.

Establish a SSH connection to the Linux machine or log in on the text Linux console. You should either log in as root or obtain root permissions after login via su or sudo command.



Step 1. Check if JDK is Already Installed

In order to check if Java Development Kit is installed on the computer, do the following.

1. Execute the following command:

java -version

The system displays information on currently installed Java applications.

In case JDK version needed is not installed on the computer, proceed to Step 2 to install it.

Step 2. Install Java Development Kit (JDK)

For Ubuntu, Debian

1. Execute the following command to add the repository:

sudo add-apt-repository ppa:sun-java-community-team/sun-java6

2. Execute the following commands to update the repository and install JDK:

sudo apt-get update
sudo apt-get install sun-java6-jdk

3. Operation log is displayed. The system automatically downloads necessary files from web for installation. The system asks to confirm the installation process continuation. Type "Y", and press "Enter."

4. After the installation process is complete, jdk and jre are installed to /usr/lib/jvm/<java> directory, where <java> is the actual java installation folder. For example, /usr/lib/jvm/java-6-sun.

For CentOS, RedHat and Fedora

1. Download sun-JDK from the official Oracle site. Open a Web browser and access the following URL:

http://www.oracle.com/technetwork/java/javase/downloads/

While selecting a packet to upload, choose the RPM.

2. Start the remote SSH session in the GUI terminal window (Konsole in KDE, Gnome Terminal in Gnome, etc.) or open the Linux text console.

3. Install the downloaded version of JDK.

sudo sh ./jdk-6u25-linux-i586-rpm.bin

4. Execute the following command to add installed JDK to alternatives:

sudo /usr/sbin/alternatives --install /usr/bin/java java /usr/java/latest/bin/java 2

5. Choose which version of JDK to use:

sudo /usr/sbin/alternatives --config java

For example, to use the sun-jdk, choose "3" and press "Enter."

6. Check the installed and configured JDK by typing following command:

java -version

The output will show you the version of the JDK installed in your system.

7. Add JAVA_HOME to your PATH:

export JAVA_HOME=/usr/java/jdk1.6.0_25/

Note:

After Java Development Kit (JDK) is installed, check that the JAVA_HOME environment variable has been set correctly. This is necessary for WSO2 DSS installation. Proceed to Set up JAVA_HOME section for the detailed information on the JAVA_HOME environment variable set up, and to Verify JAVA_HOME Set Up.

Notice

In case of Data Services Server installation from source distribution, ensure that Apache Maven is installed. See Installing Apache Maven on Linux.