Opened 12 years ago
Closed 8 years ago
#8700 closed defect (fixed)
Missing path for java on Debian/Ubuntu
Reported by: | ggeldenhuis | Owned by: | bastiK |
---|---|---|---|
Priority: | minor | Milestone: | |
Component: | Ubuntu package | Version: | |
Keywords: | Cc: |
Description
I uses a very old Ubuntu so not sure that this is a relevant but feel free to close it if it is not.
Running josm after a fresh install/update causes it to complain about the java version not being supported.
Running java -version on the command line give me:
java version "1.7.0_17"
Java(TM) SE Runtime Environment (build 1.7.0_17-b02)
Java HotSpot(TM) Server VM (build 23.7-b01, mixed mode)
so the java version is comparatively up to date.
The problem seems to be in the assumptions that is made about the path in the startup script.
The command whereis java shows:
/usr/bin/java
Adding that to the script called: /usr/bin/josm-latest on the following lines cause it to work properly.
# If OpenJDK is only available headless, do not try it
if dpkg --get-selections 'openjdk-*-jre' | grep install$ > /dev/null ; then
JAVA_CMDS="$JAVA_HOME/bin/java /usr/lib/jvm/java-7-openjdk/bin/java /usr/lib/jvm/java-7-openjdk-$ARCH/bin/java /usr/lib/jvm/java-6-openjdk/bin/java /usr/lib/jvm/java-6-openjdk-$ARCH/bin/java /usr/lib/jvm/java-6-sun/bin/java /usr/bin/java"
else
JAVA_CMDS="$JAVA_HOME/bin/java /usr/lib/jvm/java-6-sun/bin/java /usr/lib/jvm/java-7-oracle/bin/java /usr/bin/java"
fi
"Ubuntu 11.04"
Attachments (0)
Change History (17)
comment:1 by , 12 years ago
comment:2 by , 12 years ago
Component: | Core → Ubuntu package |
---|---|
Owner: | changed from | to
comment:3 by , 12 years ago
As requested:
update-alternatives --list java
/usr/lib/jvm/java-6-openjdk/jre/bin/java
/usr/lib/jvm/java-7-oracle/jre/bin/java
ls -og $(which java)
lrwxrwxrwx 1 22 2013-04-08 18:40 /usr/bin/java -> /etc/alternatives/java
ls -og /etc/alternatives/java
lrwxrwxrwx 1 39 2013-04-08 18:40 /etc/alternatives/java -> /usr/lib/jvm/java-7-oracle/jre/bin/java
comment:4 by , 12 years ago
Thanks
Sorry forgot the most important one:
ls -og /usr/lib/jvm/java-?-*/bin/java
comment:5 by , 12 years ago
ls -og /usr/lib/jvm/java-?-*/bin/java
lrwxrwxrwx 1 15 2012-10-30 23:58 /usr/lib/jvm/java-6-openjdk/bin/java -> ../jre/bin/java
lrwxrwxrwx 1 15 2013-04-08 18:32 /usr/lib/jvm/java-7-oracle-1.7.0.17/bin/java -> ../jre/bin/java
lrwxrwxrwx 1 15 2013-04-08 18:32 /usr/lib/jvm/java-7-oracle/bin/java -> ../jre/bin/java
comment:6 by , 12 years ago
@bastiK
Pathes seem to be OK.
Is this intended to point the users to openjdk-7 ?
follow-up: 9 comment:7 by , 12 years ago
@skyper,ggeldenhuls: do you think the following fixes the problem?
-
latest/usr/bin/josm-latest
11 11 12 12 # If OpenJDK is only available headless, do not try it 13 13 if dpkg --get-selections 'openjdk-*-jre' | grep install$ > /dev/null ; then 14 JAVA_CMDS="$JAVA_HOME/bin/java /usr/lib/jvm/java-7-openjdk/bin/java /usr/lib/jvm/java-7-openjdk-$ARCH/bin/java /usr/lib/jvm/java- 6-openjdk/bin/java /usr/lib/jvm/java-6-openjdk-$ARCH/bin/java /usr/lib/jvm/java-6-sun/bin/java"14 JAVA_CMDS="$JAVA_HOME/bin/java /usr/lib/jvm/java-7-openjdk/bin/java /usr/lib/jvm/java-7-openjdk-$ARCH/bin/java /usr/lib/jvm/java-7-oracle/bin/java /usr/lib/jvm/java-6-openjdk/bin/java /usr/lib/jvm/java-6-openjdk-$ARCH/bin/java /usr/lib/jvm/java-6-sun/bin/java" 15 15 else 16 16 JAVA_CMDS="$JAVA_HOME/bin/java /usr/lib/jvm/java-6-sun/bin/java /usr/lib/jvm/java-7-oracle/bin/java /usr/bin/java" 17 17 fi -
tested/usr/bin/josm
11 11 12 12 # If OpenJDK is only available headless, do not try it 13 13 if dpkg --get-selections 'openjdk-*-jre' | grep install$ > /dev/null ; then 14 JAVA_CMDS="$JAVA_HOME/bin/java /usr/lib/jvm/java-7-openjdk/bin/java /usr/lib/jvm/java-7-openjdk-$ARCH/bin/java /usr/lib/jvm/java- 6-openjdk/bin/java /usr/lib/jvm/java-6-openjdk-$ARCH/bin/java /usr/lib/jvm/java-6-sun/bin/java"14 JAVA_CMDS="$JAVA_HOME/bin/java /usr/lib/jvm/java-7-openjdk/bin/java /usr/lib/jvm/java-7-openjdk-$ARCH/bin/java /usr/lib/jvm/java-7-oracle/bin/java /usr/lib/jvm/java-6-openjdk/bin/java /usr/lib/jvm/java-6-openjdk-$ARCH/bin/java /usr/lib/jvm/java-6-sun/bin/java" 15 15 else 16 16 JAVA_CMDS="$JAVA_HOME/bin/java /usr/lib/jvm/java-6-sun/bin/java /usr/lib/jvm/java-7-oracle/bin/java /usr/bin/java" 17 17 fi
(updated tested version, latest will be fixed tomorrow)
follow-up: 12 comment:8 by , 12 years ago
We should also update the "else" clause where Java 6 is before Java 7
follow-up: 11 comment:9 by , 12 years ago
Replying to bastiK:
@skyper,ggeldenhuls: do you think the following fixes the problem?
Yes, this should work, Though I would add it just before java-6-sun.
I had a look at the whole file:
Problem is the else statement which will never be reached if any openjdk-* is proper installed but not used.
Don-Vip is right, with switching the versions in the else statement.
@bastiK:
Did not find the sources for the packages. Did look in the svn and in the repository.
comment:10 by , 12 years ago
Actually the whole if statement should be adjusted. Think it is only needed if "alternatives" points to openjdk. Something like this should work (untested):
-
latest/usr/bin/josm-latest
10 10 ARCH="`dpkg --print-architecture 2> /dev/null || true`" 11 11 12 12 # If OpenJDK is only available headless, do not try it 13 if dpkg --get-selections 'openjdk-*-jre' | grep install$ > /dev/null; then14 JAVA_CMDS="$JAVA_HOME/bin/java /usr/lib/jvm/java-7-openjdk/bin/java /usr/lib/jvm/java-7-openjdk-$ARCH/bin/java /usr/lib/jvm/java- 7-oracle/bin/java /usr/lib/jvm/java-6-openjdk/bin/java /usr/lib/jvm/java-6-openjdk-$ARCH/bin/java /usr/lib/jvm/java-6-sun/bin/java"13 if [ readlink -n -f /etc/alternatives/java | grep openjdk ] && [ dpkg --get-selections 'openjdk-*-jre' | grep install$ > /dev/null ]; then 14 JAVA_CMDS="$JAVA_HOME/bin/java /usr/lib/jvm/java-7-openjdk/bin/java /usr/lib/jvm/java-7-openjdk-$ARCH/bin/java /usr/lib/jvm/java-6-openjdk/bin/java /usr/lib/jvm/java-6-openjdk-$ARCH/bin/java" 15 15 else 16 JAVA_CMDS="$JAVA_HOME/bin/java /usr/lib/jvm/java- 6-sun/bin/java /usr/lib/jvm/java-7-oracle/bin/java /usr/bin/java"16 JAVA_CMDS="$JAVA_HOME/bin/java /usr/lib/jvm/java-7-oracle/bin/java /usr/lib/jvm/java-6-sun/bin/java /usr/bin/java" 17 17 fi 18 18 19 19 JAVA_OPTS="-Djosm.home=$HOME/.josm-latest -Djava.net.useSystemProxies=true $JAVA_OPTS"
EDT: Otherwise we will have the same problem with other javas and openjdk installed.
follow-up: 13 comment:11 by , 12 years ago
Replying to skyper:
@bastiK:
Did not find the sources for the packages. Did look in the svn and in the repository.
The binary inside the .deb is identical to the .jar file you can download from this website. Everything else in the package is plain text.
At the moment I don't change anything unless there is a specific problem reported by a user. Generally, I try to keep the package in sync with the Debian package as much as possible. So you can help improving the "upstream" project, and the changes will be applied to our repository eventually.
follow-up: 14 comment:12 by , 12 years ago
Replying to Don-vip:
We should also update the "else" clause where Java 6 is before Java 7
Go ahead! :)
comment:13 by , 12 years ago
Replying to bastiK:
Replying to skyper:
@bastiK:
Did not find the sources for the packages. Did look in the svn and in the repository.
The binary inside the .deb is identical to the .jar file you can download from this website. Everything else in the package is plain text.
At the moment I don't change anything unless there is a specific problem reported by a user. Generally, I try to keep the package in sync with the Debian package as much as possible. So you can help improving the "upstream" project, and the changes will be applied to our repository eventually.
Ok, I filled a bug "upstream": #708126
The order should not make any differences as the list is only used to find a exact match.
comment:14 by , 12 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Replying to bastiK:
Replying to Don-vip:
We should also update the "else" clause where Java 6 is before Java 7
Go ahead! :)
Done:
svn ci -m "fix #8700 - use oracle-java-7 before sun-java-6" Sending apt-source/latest/usr/bin/josm-latest Sending apt-source/tested/usr/bin/josm Transmitting file data .. Committed revision 53.
comment:16 by , 12 years ago
Resolution: | fixed |
---|---|
Status: | closed → reopened |
Summary: | Missing path for java → Missing path for java on Debian/Ubuntu |
Just the else clause, I thought the other points had been fixed.
Sorry if I closed it too fast.
comment:17 by , 8 years ago
Resolution: | → fixed |
---|---|
Status: | reopened → closed |
I believe this has been fixed in the meanwhile with the transitions to Java 7 then Java 8.
Could you please add the result of
update-alternatives --list java
ls -og ($which java)
andls -og /etc/alternatives/java
?Thanks
Mine are:
and