Select JVM for NetBeans

Markus Schönhaber ubuntu-users at list-post.mks-mail.de
Thu Jan 15 16:05:11 UTC 2009


Thufir:

> Also, I notice:
> 
> thufir at arrakis:~$ which java
> /usr/bin/java
> thufir at arrakis:~$ ll /usr/bin/java
> lrwxrwxrwx 1 root root 22 2009-01-06 19:08 /usr/bin/java -> /etc/
> alternatives/java
> thufir at arrakis:~$ ll /etc/alternatives/java
> lrwxrwxrwx 1 root root 36 2009-01-14 08:38 /etc/alternatives/java -> /usr/
> lib/jvm/java-6-sun/jre/bin/java
> thufir at arrakis:~$ 
> thufir at arrakis:~$ which javac
> /usr/bin/javac
> thufir at arrakis:~$ ll /usr/bin/javac 
> lrwxrwxrwx 1 root root 23 2009-01-14 00:24 /usr/bin/javac -> /etc/
> alternatives/javac
> thufir at arrakis:~$ ll /etc/alternatives/javac
> lrwxrwxrwx 1 root root 37 2009-01-14 08:25 /etc/alternatives/javac -> /
> usr/lib/jvm/java-6-openjdk/bin/javac
> thufir at arrakis:~$ 

So what? You've noticed that changing one binary managed by the
alternatives system doesn't affect other (different) binaries managed by
the alternatives system. Doesn't seem surprising to me.

> It seems that java uses the sun binary, while javac is using openjdk.  
> From what I read there's probably no difference for my needs, but, still, 
> I'd prefer to use the "official" version.

If you want /usr/bin/javac to point to the javac from the Sun JDK, do
something similar to what you did wrt /usr/bin/java:
sudo update-alternatives --config javac
And while you're at it, do the same for appletviewer, javadoc, javah,
jar, jarsigner, javaws, jconsole, ...
Or simply uninstall OpenJDK if you're not going to use it anyway.
Or prepend your path with the bin directory of your preferred Java
installation.

Or - maybe the least painful way to change the all Java alternatives -
take a look at update-java-alternatives.

Regards
  mks




More information about the ubuntu-users mailing list