Oracle jdk 8u25 running on OpenSUSE 13.1

As you probably know, Oracle denied to distribute jre/jdk of Oracle Java directly in linux distributions. Exchange with OpenJDK packages was cruel, anyway there are few ways how to install original Java environment again.

1) Uninstall anything similar to jdk/jre from Open*. It should look like:

ji@linux-ss0s:~/install/JetBrains> java -version
java version „1.5.0“
gij (GNU libgcj) version 4.8.1 20130909 [gcc-4_8-branch revision 202388]

Copyright (C) 2007 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

2) Download and install Java jdk from this URL 🙂

3) Update/install package update-alternatives from repositories (zypper in update-alternatives )

4) Play with update-alternatives utility 🙂 It‘ s simply like a link creation with some additional features (in fact multi-versions management + priority setting)

 

linux-ss0s:~ # update-alternatives –install /usr/bin/java java /usr/java/jdk1.8.0_25/bin/java 1065

linux-ss0s:~ #  update-alternatives –install /usr/bin/javac javac /usr/java/jdk1.8.0_25/bin/javac 1065
update-alternatives: using /usr/java/jdk1.8.0_25/bin/javac to provide /usr/bin/javac (javac) in auto mode
linux-ss0s:~ #  update-alternatives –install /usr/bin/jar jar /usr/java/jdk1.8.0_25/bin/jar 1065
update-alternatives: using /usr/java/jdk1.8.0_25/bin/jar to provide /usr/bin/jar (jar) in auto mode
linux-ss0s:~ #  update-alternatives –install /usr/bin/javaws javaws /usr/java/jdk1.8.0_25/bin/javaws 1065
update-alternatives: using /usr/java/jdk1.8.0_25/bin/javaws to provide /usr/bin/javaws (javaws) in auto mode
linux-ss0s:~ #  update-alternatives –config java
There are 2 choices for the alternative java (providing /usr/bin/java).

  Selection    Path                                   Priority   Status
————————————————————
* 0            /usr/lib64/jvm/jre-1.5.0-gcj/bin/java   1500      auto mode
  1            /usr/java/jdk1.8.0_25/bin/java          1065      manual mode
  2            /usr/lib64/jvm/jre-1.5.0-gcj/bin/java   1500      manual mode

Press enter to keep the current choice[*], or type selection number: 1
update-alternatives: using /usr/java/jdk1.8.0_25/bin/java to provide /usr/bin/java (java) in manual mode

And we can of course verify new setting:

linux-ss0s:~ # java -version
java version „1.8.0_25“
Java(TM) SE Runtime Environment (build 1.8.0_25-b17)
Java HotSpot(TM) 64-Bit Server VM (build 25.25-b02, mixed mode)

-a-

This entry was posted in Linux. Bookmark the permalink.

Comments are closed.