0

I just installed Java 8 on my new VPS I set the links correctly but, still java, or javac won`t work:

root@vpsXXXXX:~# update-alternatives --display java
java - Auto-Modus
  Link verweist zur Zeit auf /usr/lib/jvm/java-8-oracle/bin/java
/usr/lib/jvm/java-8-oracle/bin/java - Priorität 1
Gegenwärtig »beste« Version ist »/usr/lib/jvm/java-8-oracle/bin/java«.
root@vps149825:~#

More specificly:

root@vpsXXXXX:~# ls -l $(readlink -f /usr/bin/java)
-rwxr-xr-x 1 uucp 143 5730 Feb 11 07:26 /usr/lib/jvm/jdk1.8.0_40/bin/java
root@vpsXXXXX:~# ls -l /usr/bin/java
lrwxrwxrwx 1 root root 22 Mär 11 13:32 /usr/bin/java -> /etc/alternatives/java
root@vpsXXXXX:~# ls -l /etc/alternatives/java
lrwxrwxrwx 1 root root 35 Mär 11 13:39 /etc/alternatives/java -> /usr/lib/jvm/java-8-oracle/bin/java
root@vpsXXXXX:~#

sry for the german, but I think this is rather clear. So the link is not the problem. Even if I go into the directoy and try to execute java from there it is not working.

root@vps149825:~# cd ../usr/lib/jvm/java-8-oracle/bin/
root@vps149825:/usr/lib/jvm/java-8-oracle/bin# ls
appletviewer  javafxpackager  jdb      jrunscript    pack200      unpack200
ControlPanel  javah           jdeps    jsadebugd     policytool   wsgen
extcheck      javap           jhat     jstack        rmic         wsimport
idlj          javapackager    jinfo    jstat         rmid         xjc
jar           java-rmi.cgi    jjs      jstatd        rmiregistry
jarsigner     javaws          jmap     jvisualvm     schemagen
java          jcmd            jmc      keytool       serialver
javac         jconsole        jmc.ini  native2ascii  servertool
javadoc       jcontrol        jps      orbd          tnameserv
root@vps149825:/usr/lib/jvm/java-8-oracle/bin# ./java
-bash: ./java: Datei oder Verzeichnis nicht gefunden
root@vps149825:/usr/lib/jvm/java-8-oracle/bin#

Also when I try

ldd /usr/lib/jvm/jdk1.8.0_40/bin/java

it says:

not a dynamic executable

Also:

root@vpsXXXXXXX:/usr/lib/jvm/jdk1.8.0_40/bin# file java
java: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.9, BuildID[sha1]=0x476386745161d6029010bc153c65060693cca771, not stripped

I kind of think that there are some dependencies missing?

I use a debian 6.7 machine 64 bit.

2 Answers 2

1

Check if all symlinks used for alternatives are ok:

ls -l $(readlink -f /usr/bin/java)

If a link is missing try to find it by listing recursively. E.g:

ls -l /usr/bin/java
ls -l /etc/alternatives/java
...
7
  • I tried it and the linking is totally fine, I think there is some other issue because I cant even execute java or javac when I navigate directly into the folder Mar 11, 2015 at 14:30
  • I added your commands in the Edit of the OP Mar 11, 2015 at 14:46
  • you can run ldd /usr/lib/jvm/jdk1.8.0_40/bin/java to see which libraries are linked dynamically and used at startup. Mar 11, 2015 at 15:26
  • When I try this command it says not a dynamic executable any idea what that means? Mar 11, 2015 at 19:19
  • 1
    Maybe the problem is, that its a 32bit? Mar 12, 2015 at 10:42
0

The Problem was I accidently installed the 32-bit Java version even though I have a 64-bit system. If anybody know why the 32-bit version didn`t work (cause it normally should work on a 64-bit maschine) I would appreciate to know.

Anyway installing the 64-bit Version fixed the problem.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .