Skip to content

Java install

Step 1:  Download java

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

Step 2:

Copy the appropriate java file to linux server using winscp

jdk-7u15-linux-x64.rpm

 

Step 3:

[root@bip java]# rpm -ivh jdk-7u15-linux-x64.rpm
Preparing… ########################################### [100%]
1:jdk ########################################### [100%]
Unpacking JAR files…
rt.jar…
Error: Could not open input file: /usr/java/jdk1.7.0_15/jre/lib/rt.pack
jsse.jar…
Error: Could not open input file: /usr/java/jdk1.7.0_15/jre/lib/jsse.pack
charsets.jar…
Error: Could not open input file: /usr/java/jdk1.7.0_15/jre/lib/charsets.pack
tools.jar…
Error: Could not open input file: /usr/java/jdk1.7.0_15/lib/tools.pack
localedata.jar…
Error: Could not open input file: /usr/java/jdk1.7.0_15/jre/lib/ext/localedata.p

Ignore this above error

Step 4:

[root@bip java]# alternatives –install /usr/bin/java java /usr/java/jdk1.7.0_15 /bin/java 2
[root@bip java]# alternatives –config java

There are 3 programs which provide ‘java’.

Selection Command
———————————————–
* 1 /usr/lib/jvm/jre-1.4.2-gcj/bin/java
2 /usr/java/jdk1.7.0_15/bin/java
+ 3 /usr/java/jdk1.6.0_41/bin/java

Enter to keep the current selection[+], or type selection number: 2

Step 5:

[root@bip java]# java -version
java version “1.7.0_15”
Java(TM) SE Runtime Environment (build 1.7.0_15-b03)
Java HotSpot(TM) 64-Bit Server VM (build 23.7-b01, mixed mode)

Step 6 :

If you want set the java home path in oracle

[root@bip ~]# su – oracle
[oracle@bip ~]$ vi .bash_profile

#Java Settings
JAVA_HOME=/usr/java/jdk1.7.0_15; export JAVA_HOME
PATH=/usr/sbin:$PATH; export PATH
PATH=$JAVA_HOME/bin:$PATH; export PATH

save it

Step 7:

[oracle@bip ~]$ which java
/usr/java/jdk1.7.0_15/bin/java

Step 8:

Symbolic creation

[root@bip jvm]# ln -s /usr/java/jdk1.7.0_15 /usr/lib/jvm/jdk1.7.0_15

[root@bip jvm]# ls -l jdk1.7.0_15
lrwxrwxrwx 1 root root 21 Feb 23 22:50 jdk1.7.0_15 -> /usr/java/jdk1.7.0_15

No comments yet

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: