Install jdk and ant commands in Ubuntu

Source: Internet
Author: User
Tags echo command
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.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.