I've got java-6-openjdk and java-7-openjdk running on Natty (11.04) on one machine and successfully toggle between them using update-alternatives --config java (or javac).
For some reason this doesn't seem to work on a second machine of identical spec.
Hello, the default java installation is openJDK.
/usr/bin/java -> /etc/alternatives/java
/etc/alternatives/java -> /usr/lib/jvm/jre-1.7.0-openjdk.x86_64/bin/java
I want to install JDK 1.6, and executed this command:
Code:
alternatives --install /usr/bin/java java /usr/lib/java/jdk1.6.0_45/bin/java 20000
But the symbolic link does change at all. What might be wrong?
What is the command update-alternatives used for?
Take this example:
sudo update-alternatives --install /usr/bin/java java /usr/local/java/jre1.7.0_09/bin/java 1
What does it do? How is it different from adding jdk to the path?
Let's say that I have run the command. How would I revert back to the original state?
Code:
root@opus:~# sudo update-alternatives --install "/usr/share/java" "java" "/usr/share/java/jdk1.7.0/bin/java" 1
update-alternatives: warning: forcing reinstallation of alternative /usr/share/java/jdk1.7.0/bin/java because link group java is broken.
update-alternatives: warning: not replacing /usr/share/java with a link.
Please help
I want to have two JDKs. The first one was installed a long time ago to /usr/lib/jvm/java-7-oracle/.
when I load the application, I get
Code:
/usr/lib/jvm/java-7-ibm/jre/bin/java/bin/java not found
????
How come it is not working?
I followed the instructions here
http://www.wikihow.com/Install-IBM-Java-on-Ubuntu-Linux
however I only loaded sdk since it has jre.
Sorry for my bad English, but I'm really trying to be better.
Ok. I've created a new command/alias(changejava) on Ubuntu 12.04, and I need to skip "sudo password" only when I write "$changejava".
If I write "$changejava" using terminal, Ubuntu show me what can I do. I just need to press 0, 1 or 2.
Compiling is easy but when using java to run the programs, it gives Exception found. I am using Ubuntu 12.04 without internet connections. Also, installed Oracle JDK7 and JRE7. Also did the update-alternatives command on java, javac and javaws. Changed the machine java in /etc/profiles. PATH is pointing to oracle java folder.
Recently I installed jdk 1.7 in ubuntu. These are the steps that I used to install it.
1. Extracted the folder named 'jdk1.7.0' and copied it to '/usr/lib/jvm'.
2. Installed javac using the following command
sudo update-alternatives --install /usr/bin/javac javac /usr/lib/jvm/jdk1.7.0/bin/javac 4
3.