Fedora 13 and Sun Java installation

Back so soon, yeah I know …

Another issue that I came across regarding Java. In my day to day work my major application is dependent on Java and it cannot be IcedTea or the java-gcj version. It really has to be Sun version.

At first I was thinking it would be a nightmare, but after searching a bit I found what I was looking for. In a way of compiling the big information, here it goes what I’ve done to install it and configure it properly in my system

1. step -> Download java JDK rpm file.
http://java.sun.com/javase/downloads/index.jsp
at the time of this writing: jdk-6u20-linux-x64-rpm.bin

2. step – Install the rpm file, it’s going to install several rpm actually
# chmod +x jdk-6u20-linux-x64-rpm.bin

The java will be installed at: /usr/java
lrwxrwxrwx. 1 root root 16 May 6 15:32 default -> /usr/java/latest
drwxr-xr-x. 9 root root 4096 May 6 15:32 jdk1.6.0_20
lrwxrwxrwx. 1 root root 21 May 6 15:32 latest -> /usr/java/jdk1.6.0_20

After this you will need to configure the alternatives to recognize the new java version installed. I’ve saved a file with all that is needed, or at least for all that I need.

/usr/sbin/alternatives –install /usr/bin/java java /usr/java/latest/bin/java 20000 \
–slave /usr/bin/javaws javaws /usr/java/latest/bin/javaws \
–slave /usr/bin/keytool keytool /usr/java/latest/bin/keytool \
–slave /usr/bin/orbd orbd /usr/java/latest/bin/orbd \
–slave /usr/bin/rmid rmid /usr/java/latest/bin/rmid \
–slave /usr/bin/rmiregistry rmiregistry /usr/java/latest/bin/rmiregistry \
–slave /usr/bin/servertool servertool /usr/java/latest/bin/servertool \
–slave /usr/bin/tnameserv tnameserv /usr/java/latest/bin/tnameserv \
–slave /usr/bin/pack200 pack200 /usr/java/latest/bin/pack200 \
–slave /usr/lib/jvm/jre jre /usr/java/latest/jre \
–slave /usr/bin/unpack200 unpack200 /usr/java/latest/bin/unpack200

You can now choose what version of java you want to use by issuing the command:
# alternatives –config java

There are 3 programs which provide ‘java’.

Selection Command
———————————————–
1 /usr/lib/jvm/jre-1.6.0-openjdk.x86_64/bin/java
2 /usr/lib/jvm/jre-1.5.0-gcj/bin/java
*+ 3 /usr/java/latest/bin/java

Hope it helps anyone out there.

Advertisements

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 )

Google+ photo

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

Twitter picture

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

Facebook photo

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

Connecting to %s