symlink '/usr/java/latest' missing

38 views
Skip to first unread message

rmou...@uw.edu

unread,
Oct 12, 2017, 4:52:26 PM10/12/17
to rocks7-beta
On my test cluster, a piece of the java puzzle is missing:

$ echo $JAVA_HOME
/usr/java/latest

$ ls -al /usr/java/latest
ls: cannot access /usr/java/latest: No such file or directory

On a Rocks 6.2 cluster, yum reports that the file (symlink) is provided by the java3d and antlr packages, from the Rocks-6.2 repository. Are either of those packages (or equivalent) available for Rocks 7.0?

Trevor Cooper

unread,
Oct 12, 2017, 7:39:29 PM10/12/17
to rocks7-beta
Not surprised... :)

CentOS 7 includes openjdk out of the box not Oracle JRE/JDK which I think may be what JAVA_HOME expects to point at.

For example, on a 'new' Rocks 7 frontend...

[tcooper@hpcdev-003 ~]$ which java
/usr/bin/java

[tcooper@hpcdev-003 ~]$ java -version
openjdk version "1.8.0_144"
OpenJDK Runtime Environment (build 1.8.0_144-b01)
OpenJDK 64-Bit Server VM (build 25.144-b01, mixed mode)

[tcooper@hpcdev-003 ~]$ rpm -qf /usr/bin/java
file /usr/bin/java is not owned by any package

[tcooper@hpcdev-003 ~]$ ls -l /usr/bin/java
lrwxrwxrwx 1 root root 22 Oct 12 16:08 /usr/bin/java -> /etc/alternatives/java

[tcooper@hpcdev-003 ~]$ ls -l /etc/alternatives/java
lrwxrwxrwx 1 root root 73 Oct 12 16:08 /etc/alternatives/java -> /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.144-0.b01.el7_4.x86_64/jre/bin/java

[tcooper@hpcdev-003 ~]$ rpm -qf /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.144-0.b01.el7_4.x86_64/jre/bin/java
java-1.8.0-openjdk-headless-1.8.0.144-0.b01.el7_4.x86_64

[tcooper@hpcdev-003 ~]$ rpm -qa | grep openjdk
java-1.8.0-openjdk-headless-1.8.0.144-0.b01.el7_4.x86_64
java-1.8.0-openjdk-1.8.0.144-0.b01.el7_4.x86_64

To be fair though this was broken on my system after install.

Perhaps because the post-install scriptlet in the openjdk RPM didn't setup this version of java last using alternatives though not sure.

Fixing it to get the above was easy enough with...

# yum reinstall java-1.8.0-openjdk-headless

...though admittedly that shouldn't be necessary.

I think we started dropping a symlink on our CentOS 6 systems which we had updated Java on since install.

The result is something like this...

[tcooper@tscc-login2 ~]$ which java
/usr/bin/java

[tcooper@tscc-login2 ~]$ ls -l /usr/bin/java
lrwxrwxrwx 1 root root 22 Jun 28 17:22 /usr/bin/java -> /etc/alternatives/java

[tcooper@tscc-login2 ~]$ ls -l /etc/alternatives/java
lrwxrwxrwx 1 root root 46 Jun 28 17:22 /etc/alternatives/java -> /usr/lib/jvm/jre-1.7.0-openjdk.x86_64/bin/java

[tcooper@tscc-login2 ~]$ echo $JAVA_HOME
/usr/java/latest

[tcooper@tscc-login2 ~]$ ls -l /usr/java/latest
lrwxrwxrwx 1 root root 17 Jun 28 18:40 /usr/java/latest -> /usr/lib/jvm/java

[tcooper@tscc-login2 ~]$ ls -l /usr/lib/jvm/java
lrwxrwxrwx 1 root root 26 Jun 28 16:44 /usr/lib/jvm/java -> /etc/alternatives/java_sdk

[tcooper@tscc-login2 ~]$ ls -l /etc/alternatives/java_sdk
lrwxrwxrwx 1 root root 59 Jun 28 16:44 /etc/alternatives/java_sdk -> /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.31-1.b13.el6_6.x86_64

How we should handle this for the base install of Rocks 7 I'll leave to Phil... :)

Trevor
Reply all
Reply to author
Forward
0 new messages