Ever since I upgraded my Ubuntu from 9.10 to 10.04 I can't start Netbeans any more, because apparently they are dropping support for Java's JDK in favor of OpenJDK. Well, problem is, my IDEs won't work with OpenJDK.
apt-get install sun-java6-jdk开发者_如何学JAVA
is not working. I downloaded the Linux installation file from Sun (jdk-6u21-linux-i586.bin) and installed it, but I can't call java or javac from the terminal.
Can anyone help me here?
Here is how you would install it.
$ sudo add-apt-repository "deb http://archive.canonical.com/ lucid partner"
$ sudo apt-get update
$ sudo apt-get install sun-java6
Good luck.
How to install Java6 JDK on Ubuntu 10.04
sudo add-apt-repository "deb http://archive.canonical.com/ lucid partner"
sudo apt-get update
sudo apt-get install sun-java6-jdk
The NetBeans installation has a reference to the JDK that is created at install time. After the upgrade to 10.04, that reference is no longer valid.
Go to the directory where you installed NetBeans. By default it is "/usr/local/netbeans-version" if you installed as root or "$HOME/netbeans-version" if you installed as a regular user. There will be a subdirectory named "etc". In that directory, edit the "netbeans.conf" file. Look for the netbeans_jdk_home
and change it to /usr/lib/jvm/java-6-openjdk
.
I downloaded the Linux installation file from Sun (jdk-6u21-linux-i586.bin) and installed it, but I can't call java or javac from the terminal.
You missed the final step: after installing the JDK manually (instead of from the package system), you need to add the bin
directory of your JDK to the PATH
. The best way to do that in Ubuntu 10.04 is to edit the file /etc/environment
: sudo nano /etc/environment
. Log out and back in and you should be able to run Java.
To run add-apt-repository, you need to install python-software-properties
first. If you don't want to do this, you can:
- Edit the sources.list file.
sudo nano /etc/apt/sources.list
- Uncomment the lines
deb http://archive.canonical.com/ubuntu lucid partner
anddeb-src http://archive.canonical.com/ubuntu lucid partner
(they are the second set from teh bottom) sudo apt-get update
- And finally,
sudo apt-get install sun-java6-jdk
.
Java is no longer in the partner repo. You can download the binaries directly from Oracle, but much easier is to use the the Web Upd8 PPA. Complete instructions are here.
If you are looking for Sun JDK on Ubuntu Visit following source.
http://peesquare.com/blogs/install-sun-java-6-on-ubuntu-10-04-12-04-12-10-13-04-13-10-both-32-bit-and-64-bit-system/
精彩评论