FS#41832 - [java-common] Cannot run java: Too many levels of symbolic links

Attached to Project: Arch Linux
Opened by Marti (intgr) - Friday, 05 September 2014, 08:53 GMT
Last edited by Doug Newgard (Scimmia) - Friday, 05 September 2014, 13:12 GMT
Task Type Bug Report
Category Packages: Extra
Status Closed
Assigned To No-one
Architecture All
Severity High
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 5
Private No

Details

Description: After upgrading to the latest java-commnon package, I can no longer run Java...
% java
/usr/bin/java: line 2: /usr/lib/jvm/default/bin/java: Too many levels of symbolic links
/usr/bin/java: line 2: exec: /usr/lib/jvm/default/bin/java: cannot execute: Too many levels of symbolic links

There's a circular symbolic link...

% ls -l /usr/lib/jvm
total 4
lrwxrwxrwx 1 root root 7 Sep 5 11:48 default -> default
lrwxrwxrwx 1 root root 11 Sep 5 11:48 default-runtime -> default/jre
drwxr-xr-x 6 root root 4096 Mar 13 2013 java-7-openjdk
lrwxrwxrwx 1 root root 7 Sep 5 11:48 java-default-runtime -> default

Even after I fix it manually, a reinstall of java-common breaks it.

Additional info:
* package version(s)
java-common 1-7
This task depends upon

Closed by  Doug Newgard (Scimmia)
Friday, 05 September 2014, 13:12 GMT
Reason for closing:  Duplicate
Additional comments about closing:   FS#41826 
Comment by John Smith (ao123123) - Friday, 05 September 2014, 10:23 GMT
if you want to just hot-fix it, run

rm /usr/lib/jvm/default && ln -s /usr/lib/jvm/java-7-openjdk /usr/lib/jvm/default

as root. This is for openjdk installation.
Comment by Vincenzo Maffione (vmaffione) - Friday, 05 September 2014, 10:35 GMT
By the way, I see that /usr/lib/jvm/default and /usr/lib/jvm/default-runtime are not owned by any package.

$ pacman -Qo /usr/lib/jvm/default
error: No package owns default

Is this a wanted feature or a bug?
It caused problems after I tried to downgrade from java-common-1.7 to java-common-1.6, and forced me to manually remove these symbolic links and reinstall the jdk package.
Comment by Ben DeCamp (ExtraordinaryBen) - Friday, 05 September 2014, 10:38 GMT
After updating to java-common 1.7 I couldn't launch any java applications due to "Too many levels of symbolic links" as mentioned above. (Manually corrected it so I can resume using java apps.)

Oddly enough I just did a fresh Arch install on another machine. When installing jre7-openjdk on it, it did not have this issue.
Comment by Vincenzo Maffione (vmaffione) - Friday, 05 September 2014, 11:40 GMT
Hi Ben,
It may be that this behaviour you're experiencing - no problems on a fresh installation - is due to the stale pacman-untracked symbolic links that I mention in my previous comment.
Comment by Samuel Barabas (SamuelB) - Friday, 05 September 2014, 12:29 GMT
It only happens if there is a link named java-default-runtime exist and points to default.

$ ls -l /usr/lib/jvm/java-default-runtime
lrwxrwxrwx 1 root root 7 Sep 5 14:07 /usr/lib/jvm/java-default-runtime -> default

The pre_install() task of this package set the target of default to the target of java-default-runtime and creates a loop then.

Loading...