Rabu, 01 Februari 2012

Installation Java On OpenSuse

 
Installation Java On OpenSuse

Java is programming language popular in the Linux enviroment. Capability and Flexibility to run on vorius operation system to make Java can be attractive option. Here is installation procedure on OpenSuse. Download java from here

Take for Linux. Do not take that in bundle with Netbeans or other. Currently (Febuary 2012) the latest version is JDK 7u2. For Linux there are two types (Linux RPM in self-extracting files and Linux in self-extracting file), take the second, with the name jdk-7u2-linux-i586.rpm

Copy to folder /opt

Go to Console / Terminal

Install Java SE
In console, type the following command [signs # do not participate in the type. It is the root user prompt. When logged in as normal user, sysmbol is $. To enter the prompt root from a normal user type su and enter the password].


# chmod +x /opt/jdk-7u2-linux-i586.rpm

# rpm -ivh /opt/jdk-7u2-linux-i586.rpm


Check the installation


# java -version

java version “1.6.0_22″
OpenJDK Runtime Environment (IcedTea6 1.10.4) (suse-0.3.2-i386)
OpenJDK Server VM (build 20.0-b11, mixed mode)

What if we install is version 1.6.0 but the version that comes out is another version? Means that existing Java SDK embedded in OpenSUSE. Java we have just installed is located in the folder. Try to check with the following command.

#ls -l /usr/bin/java

lrwxrwxrwx 1 root root 22 Nov 23 21:44 /usr/bin/java -> /etc/alternatives/java

if the result is as above or folder does not match. we can be "forced" to OpenSuse using Java that we just installed. Type the following command:
#ln -s /opt/jdk1.6.0/bin/java /usr/bin/java

Check back with the java-version command
Make a Classpath so that the Java compiler [javac] can be known from  various folderswith the following steps:

-Create a file named. Bash_profile. Save the home directory. If you are signed in as root, save it in / root. If the entry as a normal user, store them in / home / username. On Linux, the file that begins with a dot means hidden files.

-Type the contents of the file. Bash_profile with:

#JAVA_HOME=/opt/jdk1.6.0 

#export JAVA_HOME  

#export PATH=$PATH:$JAVA_HOME/bin

- Save

- Log-off from OpenSUSE  

- re-enter

- Test Compiler. Open console, type


#javac


If it produces output, it means that the Java compiler is ready to use. If not, re-writing of CLASSPATH check and adjust the installation conditions.

Tidak ada komentar:

Posting Komentar