Install JDK7 under ubuntu (with Clojure download)

Source: Internet
Author: User

Ext.: http://www.linuxidc.com/Linux/2012-10/71557.htm

First of all, I really have to say that there are many tutorials on the internet like JDK7 installed under Ubuntu. However, most are based on the JDK6 bin file. If you go to the Oracle website now and see it, you will find that it has become a. tar.gz compressed file.

In addition this article also incidentally gave clojure download link, filename What of please according to your actual situation change!

———————————— Split Line ————————————

1. First you need to download the latest version of the JDK to the Oracle website. Go to Oracle's website and find it yourself under the download.

Give me a random URL: http://www.oracle.com/technetwork/java/javase/downloads/jdk7u7-downloads-1836413.html

2. Go to the download path and unzip the downloaded file, for example, I downloaded the file named jdk-7u7-linux-i586.tar.gz

cd xxx (your download path)

sudo tar zxvf jdk-7u7-linux-i586.tar.gz

3. To copy the extracted folder to/USR/LIB/JDK, assume that the folder I extracted is jdkjdk1.7.0_45

sudo cp-r jdkjdk1.7.0_45/usr/lib/jdk

Note: If/USR/LIB/JDK does not exist, you can manually build one, named JDK or JVM

sudo mkdir/usr/lib/jdk

4. Modify the environment variables, or use gedit with your

Vim ~/.BASHRC

Add the following lines at the bottom of the line, notice that the Red Word section should be modified based on what you downloaded to extract.

    1. Export java_home=/usr/lib/jdk1.7.0_45
    2. Export JRE_HOME=${JAVA_HOME}/JRE
    3. Export Classpath=.:${java_home}/lib:${jre_home}/lib
    4. Export Path=${java_home}/bin: $PATH

Save Exit, enter:

SOURCE ~/.BASHRC

5. If your Ubuntu does not have a default JRE installed (for example, I do not use 10.10), then you need to first

sudo apt-get install openjdk-6-jre-headless

Then enter the following three lines, or alert attention to the red Word part to be modified by its own

1. Sudo update-alternatives--install/usr/bin/java Java/usr/lib/jdk/jdk1.7.0_45/bin/java 300
2. Sudo update-alternatives--install/usr/bin/javac Javac/usr/lib/jdk/jdk1.7.0_45/bin/javac 300
3. Sudo update-alternatives--install/usr/bin/jar jar/usr/lib/jdk/jdk1.7.0_45/bin/jar 300

6. It is now largely complete, but also modify the default settings, enter

sudo update-alternatives--config java

Will let you choose 0,1,2 ..., the default is 0, corresponding to OPENJDK, we certainly need to change the path we just set

/usr/lib/jdk/jdk1.7.0_45/bin/java 300 Manual Mode

Enter the corresponding serial number, and the carriage return is OK.

You can do this by typing

Java-version

View the version number, which should show

    1. Java Version "jdk1.7.0_45"
    2. Java (TM) SE Runtime Environment (build JDK1.7.0_45-B10)
    3. Java HotSpot (TM) Server VM (build 23.3-b01, Mixed mode)

———————————— Split Line ————————————

Clojure:http://clojure.org/downloads

Download unzip, enter the corresponding directory, enter,

JAVA-CP Clojure-1.4.0.jar Clojure.main

I am under the version is 1.4.0, according to their own situation to modify it.

Then will enter the REPL, contact with Lisp children's shoes should not be unfamiliar, after you play it

Install JDK7 under ubuntu (with Clojure download)

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.