Try to install jdk under Ubunu and find that resources are always not found when installing with apt-getinstallsun-java6-jdk. Then I plan to download a bin package on the official website. The result is always unsatisfactory. I don't know why it is always a short circuit in the middle. So I still think the apt-getinstall command is reliable. I continue to work hard and finally found a solution: debhttp: // archive.canonical.com/?tumaverickpartnerthen
Try to install jdk under Ubunu and find that resources are always not found when installing with apt-get install sun-java6-jdk. Then I plan to download a bin package on the official website. The result is always unsatisfactory. I don't know why it is always a short circuit in the middle. So I still feel that the apt-get install command is reliable and I continue to fight, finally found the method:
Deb http://archive.canonical.com/Ubuntu maverick partner
Then execute
Sudo apt-get update
Apt-get install sun-java *
Sudo update-alternatives -- config java
There is only one alternative in link group java:/usr/lib/jvm/java-6-openjdk/jre/bin/java
Nothing to configure.
The path here is the installation path of java
# Java-version
Java version "1.6.0 _ 20"
OpenJDK Runtime Environment (IcedTea6 1.9.13) (6b20-1.9.13-0ubuntu1 ~ 10.04.1)
OpenJDK Client VM (build 19.0-b09, mixed mode, sharing)
Configure environment variables:
# Export JAVA_HOME =/usr/lib/jvm/java-6-openjdk/jre ---- load the JAVA root directory
# Export PATH = $ JAVA_HOME/bin: $ PATH ---- set environment variables (Application Files)
# Export CLASSPATH =.: JAVA_HOME/lib. tools. jar ---- set environment variables (class files)
# Export JAVA_HOME classpath path ---- load the three files together
Then, run the echo command on the terminal to check the environment variable settings.
# Echo $ JAVA_HOME
# Echo $ CLASSPATH
# Echo $ PATH
To install ant in ubuntu, you only need to execute
Apt-get install ant
You can.