FS#41639 - [java-common] java-common-wrapper: No such file or directory

Attached to Project: Arch Linux
Opened by mitsu (mitsu) - Wednesday, 20 August 2014, 22:49 GMT
Last edited by Guillaume ALAUX (galaux) - Monday, 08 September 2014, 20:07 GMT
Task Type Bug Report
Category Packages: Extra
Status Closed
Assigned To Guillaume ALAUX (galaux)
Architecture All
Severity Medium
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 4
Private No

Details

After upgrade to java-common 1-5 released yesterday, I noticed some Java applications don't start up (notably: Freenet daemon).
Logs show the following:

/usr/lib/java-common-wrapper: line 2: /usr/lib/jvm/java-default-runtime/bin/java-common-wrapper: No such file or directory

/usr/lib/java-common-wrapper line 2 is:
exec "${JAVA_HOME:-/usr/lib/jvm/java-default-runtime}/bin/${0##*/}" "$@"

I randomly tried changing this line into:
exec "${JAVA_HOME:-/usr/lib/jvm/java-default-runtime}/bin/java" "$@"

And this was enough to make the wrapper start just fine. I didn't do intensive tests though. Maybe a missing symlink in the package or am I doing it wrong ? (I have no experience in Java)
This task depends upon

Closed by  Guillaume ALAUX (galaux)
Monday, 08 September 2014, 20:07 GMT
Reason for closing:  Fixed
Additional comments about closing:  Fixed with icedtea-web 1.5.1-3 + java-common 1-6
Comment by Doug Newgard (Scimmia) - Thursday, 21 August 2014, 00:20 GMT
What is the output of `archlinux-java status` and `echo $JAVA_HOME`?
Comment by mitsu (mitsu) - Thursday, 21 August 2014, 08:49 GMT
Available Java environments:
java-7-openjdk/jre (default)

/usr/lib/jvm/java-default-runtime

Note: just installed java-8-openjdk, changed it as default, doing `archlinux-java fix`, without effect
Comment by Guillaume ALAUX (galaux) - Thursday, 21 August 2014, 14:50 GMT
Changing "${0##*/}" to "java" will redirect all JVM binary to "java" (even "javac", …). You do not want this, please change it back.

When you open a bug report, please provide some more detail on how to reproduce:
- Which package did you install? I *guess* this is "freenet" from AUR?
- What script do you run to get the error? I also guess this is "/opt/freenet/run.sh start"?

If the previous are right then you could set the following in "/opt/freenet/wrapper.conf" (watch out: it seems this file is "ASCII text, with CRLF, LF line terminators". Do not mess with it.)
wrapper.java.command=/usr/lib/jvm/java-default-runtime/bin/java
Comment by mitsu (mitsu) - Thursday, 21 August 2014, 15:01 GMT
Wasn't from the AUR but the AUR package doesn't significantly change "wrapper.conf".

Changed:
wrapper.java.command=java
Into:
wrapper.java.command=/usr/lib/jvm/java-default-runtime/bin/java

And the wrapper started up successfully. Needs to be corrected upstream by Freenet Project, thanks for the help and sorry for the trouble!
Comment by Guillaume ALAUX (galaux) - Thursday, 21 August 2014, 15:12 GMT
> Needs to be corrected upstream by Freenet Project
Well I think upstream should not try to figure out where the JVM is installed in the first place. Still if it really needs to know then it could rely on JAVA_HOME instead of trying to guess.
Comment by Gero (jlp2) - Friday, 22 August 2014, 14:28 GMT
There must be something wrong with the 'archlinux-java'-skript. The Symlink of /usr/lib/jvm/java-default-runtime/jre/bin/java is wrong. If I try to start a java web-App i get the result:

Aug 22 16:18:40 arch [14854]: IcedTea-Web c-plugin - for more info see itweb-settings debug options or console...
Aug 22 16:18:40 arch [14854]: IcedTea-Web c-plugin error manual log:
Aug 22 16:18:40 arch [14854]: Failed to spawn applet viewer Kindprozess »/usr/lib/jvm/java-default-runtime/jre/bin/java« konnte nicht ausgeführt werden (Datei oder Verzeichnis nicht gefunden)
Aug 22 16:18:40 arch [14854]: IcedTea-Web c-plugin - for more info see itweb-settings debug options or console....
Aug 22 16:18:40 arch [14854]: IcedTea-Web c-plugin error manual log:
Aug 22 16:18:40 arch [14854]: Unable to find java executable /usr/lib/jvm/java-default-runtime/jre/bin/java

So the Problem is the Path of the Symlink '/usr/lib/jvm/java-default-runtime/'

the Symlinks includes the Fullpath /usr/lib/jvm/java-default-runtime/jre/ but it should be just /usr/lib/jvm/java-default-runtime/ (without the folder jre).

If i correct the Symlink with:
sudo rm -r /usr/lib/jvm/java-default-runtime
sudo ln -s /usr/lib/jvm/java-8-openjdk /usr/lib/jvm/java-default-runtime

...no problems and it worked like a charm.

If I use the script again with:
sudo archlinux-java fix
...the manualy repaired Symlink was deleted and a new Symlink with the wrong Path in it, was created again. So the Program was unable to find java executable again.

So I think the Script should generate a Symlink just to "/usr/lib/jvm/java-8-openjdk" and NOT to "/usr/lib/jvm/java-8-openjdk/jre"....




Comment by Guillaume ALAUX (galaux) - Friday, 22 August 2014, 14:43 GMT
Once again: could you please provide some more info?

- What JVM package are installed among official/unofficial ones listed here [0]?
- What command did you issue to have this error?
- On what "java web-App" do you try this?
- I see you have icedtea-web installed: is this the very last version (called icedtea-web) or the previous one (called icedtea-web-java7)?

Anyway, touching the symlink by hand will **not** update links available in /usr/bin. So please instead of doing so, run "archlinux-java fix".

[0] https://wiki.archlinux.org/index.php/Java#Installation
Comment by Guillaume ALAUX (galaux) - Friday, 22 August 2014, 14:45 GMT
> If I use the script again with:
> sudo archlinux-java fix
> ...the manualy repaired Symlink was deleted and a new Symlink with the wrong Path in it, was created again. So the Program was unable to find java executable again.
Are you sure you have a JDK installed?

$ pacman -Qs java-environment
$ archlinux-java status
Comment by Gero (jlp2) - Friday, 22 August 2014, 14:59 GMT
- What JVM package are installed among official/unofficial ones listed here [0]?

The official ones via extra

[gero@arch ~]$ archlinux-java status
Available Java environments:
java-8-openjdk/jre (default)

- What command did you issue to have this error?

Install the latest Icedtea (icedtea-web) from extra, start Firefox an go to https://www.java.com/de/download/installed.jsp

- On what "java web-App" do you try this?
See above
- I see you have icedtea-web installed: is this the very last version (called icedtea-web) or the previous one (called icedtea-web-java7)?
The latest "icedtea-web"

Are you sure you have a JDK installed?
No, I have installed icedtea-web with the dependencies:

local/ca-certificates-java 20140324-3
Common CA certificates (JKS keystore)
local/gjs 1.40.1-1
Javascript Bindings for GNOME
local/icedtea-web 1.5.1-1
Free web browser plugin to run applets written in Java and an implementation of Java Web Start
local/java-common 1-5
Common files for Java Environments
local/jre8-openjdk 8.u20-1
OpenJDK Java 8 full runtime environment
local/jre8-openjdk-headless 8.u20-1
OpenJDK Java 8 headless runtime environment
local/js 24.2.0-1
JavaScript interpreter and libraries
local/js17 17.0.0-1
JavaScript interpreter and libraries (legacy)
local/libreoffice-common 4.2.5-1 (libreoffice)
Common files for LibreOffice - a productivity suite that is compatible with other major office suites
local/qt5-declarative 5.3.1-1 (qt qt5)
Classes for QML and JavaScript languages

Do I need to install the whole JDK? I think the JRE is enough für IcedTea...
Comment by Guillaume ALAUX (galaux) - Friday, 22 August 2014, 15:12 GMT
So if you have **no** JDK installed then the symlink must NOT point at "java-8-openjdk", but at "java-8-openjdk/jre" which is what "archlinux-java" sets. If you only have a JRE, there is no "java-8-openjdk/bin" dir but there is a "java-8-openjdk/jre/bin" dir.

Do the following return an error?
# archlinux-java fix
$ java -version

(The java plugin test page you link works for me with jre8-openjdk + icedtea-web)
Comment by Gero (jlp2) - Friday, 22 August 2014, 15:27 GMT
No errors

[gero@arch ~]$ sudo archlinux-java fix
[gero@arch ~]$ java -version
openjdk version "1.8.0_20"
OpenJDK Runtime Environment (build 1.8.0_20-b23)
OpenJDK 64-Bit Server VM (build 25.20-b22, mixed mode)

(The java plugin test page you link works for me with jre8-openjdk + icedtea-web)

With the whole JDK installed (jre8-openjdk + jdk8-openjdk + IcedTea) it works.

If I try it after "sudo pacman -Rcns jdk8-openjdk" just with jre8-openjdk + IcedTea it stops working again:

Aug 22 17:23:03 arch [15701]: Unable to find java executable /usr/lib/jvm/java-default-runtime/jre/bin/java
Aug 22 17:23:03 arch firefox.desktop[15630]: Unable to find java executable /usr/lib/jvm/java-default-runtime/jre/bin/java
Comment by Guillaume ALAUX (galaux) - Friday, 22 August 2014, 15:38 GMT
(This is not our issue but I think you do not want pacman "-c" option here)

What is JAVA_HOME set to?
Comment by Gero (jlp2) - Friday, 22 August 2014, 15:57 GMT
How can I check this?
Comment by Guillaume ALAUX (galaux) - Friday, 22 August 2014, 22:22 GMT
echo $JAVA_HOME
Comment by Gero (jlp2) - Saturday, 23 August 2014, 03:18 GMT
[gero@arch ~]$ echo $JAVA_HOME
/usr/lib/jvm/java-default-runtime

In this Symlink-Folder there is:

/usr/lib/jvm/java-default-runtime/bin
/usr/lib/jvm/java-default-runtime/lib

but the IcedTea is searching for
/usr/lib/jvm/java-default-runtime/jre/bin/java

So you think there is a Problem with IcedTea?
Comment by Gero (jlp2) - Saturday, 23 August 2014, 04:04 GMT
Ok, after I search in IcedTea I found the problem.

In the files:
/usr/share/icedtea-web/bin/itweb-settings
/usr/share/icedtea-web/bin/javaws
/usr/share/icedtea-web/bin/policyeditor

the path is set for:
JAVA=/usr/lib/jvm/java-default-runtime/jre/bin/java
...
CP=/usr/lib/jvm/java-default-runtime/jre/lib/rt.jar
...

thats wrong because with the script 'archlinux-java fix' the folder /usr/lib/jvm/java-default-runtime/ points direct to /usr/lib/jvm/java-8-openjdk/jre/ so in /usr/lib/jvm/java-default-runtime/ are only /bin and /lib and NOT /jre/bin and /jre/lib

If i fix the paths in this IcedTea-Files from
JAVA=/usr/lib/jvm/java-default-runtime/jre/bin/java
...
CP=/usr/lib/jvm/java-default-runtime/jre/lib/rt.jar

to

JAVA=/usr/lib/jvm/java-default-runtime/bin/java
...
CP=/usr/lib/jvm/java-default-runtime/lib/rt.jar

its working like it should.

So either the skript archlinux-java is wrong and should (with the JRE Package installed) point to /usr/lib/jvm/java-8-openjdk (without the folder /jre), or there is a bug in IcedTea with the paths of /usr/lib/jvm/java-default-runtime/ with just the JRE-Package installed.

should I open a new bug in IcedTea? You are the maintainer of both packages....
Comment by Guillaume ALAUX (galaux) - Tuesday, 26 August 2014, 18:48 GMT
I will need to fix icedtea-web Arch package. Still working on this.
Comment by Guillaume ALAUX (galaux) - Saturday, 30 August 2014, 16:41 GMT
@Gero: I just pushed a "-2" package that should fix this. Can you please test and report back here how it goes?
Comment by Baeyens (berbae) - Sunday, 31 August 2014, 08:59 GMT
The problem is not fixed.
with just:

icedtea-web 1.5.1-2
jre8-openjdk 8.u20-1
jre8-openjdk-headless 8.u20-1

installed, the firefox plugin doesn't work at the java test page.
It works again when I install:

jdk8-openjdk 8.u20-1
Comment by Gero (jlp2) - Sunday, 31 August 2014, 11:09 GMT
I try it with your "-2" package, but sadly it is not fixed:

Aug 31 13:05:27 arch firefox.desktop[926]: Failed to spawn applet viewer Kindprozess »/usr/lib/jvm/java-default-runtime/jre/bin/java« konnte nicht ausgeführt werden (Datei oder Verzeichnis nicht gefunden)
Aug 31 13:05:27 arch [1021]: IcedTea-Web c-plugin - for more info see itweb-settings debug options or console. See http://icedtea.classpath.org/wiki/IcedTea-Web#Filing_bugs for help.
Aug 31 13:05:27 arch [1021]: IcedTea-Web c-plugin error manual log:
Aug 31 13:05:27 arch [1021]: Failed to spawn applet viewer Kindprozess »/usr/lib/jvm/java-default-runtime/jre/bin/java« konnte nicht ausgeführt werden (Datei oder Verzeichnis nicht gefunden)
Aug 31 13:05:27 arch [1021]: IcedTea-Web c-plugin - for more info see itweb-settings debug options or console. See http://icedtea.classpath.org/wiki/IcedTea-Web#Filing_bugs for help.
Aug 31 13:05:27 arch [1021]: IcedTea-Web c-plugin error manual log:
Aug 31 13:05:27 arch [1021]: Unable to find java executable /usr/lib/jvm/java-default-runtime/jre/bin/java

Packages installed:
java-common-1-5
jre8-openjdk-8.u20-1
jre8-openjdk-headless-8.u20-1
icedtea-web-1.5.1-2

Comment by Guillaume ALAUX (galaux) - Sunday, 31 August 2014, 16:29 GMT
Yes it seems IcedTeaPlugin.so also uses its own jdkhome/jrehome path even though I "forced" with-java=/usr/bin/java.

Ok, so Icedtea-web ABSOLUTELY NEEDS to know whether the current JVM is a jdk or a jre as it hardcodes paths to jars and binaries! So I'm thinking about adding a "jre" link to java-common. That's how Fedora does it. Debian… well they have 2 packages one for OpenJDK 8 and the other for OpenJDK 7.
Comment by Baeyens (berbae) - Tuesday, 02 September 2014, 15:14 GMT
After the updates:

icedtea-web 1.5.1-2 -> 1.5.1-3
java-common 1-5 -> 1-6

the java test page works in Firefox using the jre8 packages only.
Thanks.

Loading...