Ubuntu14.04 64-bit JDK1.7 Installation

Source: Internet
Author: User

Ubuntu14.04 64-bit JDK1.7 Installation

Install JDK1.7 on Ubuntu14.04 64-bit.

1. Create a folder

Bkjia @ bkjia :~ $ Sudo mkdir/usr/lib/jvm

2. decompress the file

Bkjia @ bkjia :~ $ Sudo tarzxvf jdk-7u71-linux-x64.tar.gz-C/usr/lib/jvm

3. Open the environment variable file.

Bkjia @ bkjia :~ $ Sudo gedit/etc/profile
[Sudo] password for bkjia:

(Gedit: 6266): IBUS-WARNING **: The owner of/home/bkjia/. config/ibus/bus is not root!

(Gedit: 6266): Gtk-WARNING **: Calling Inhibit failed: grule. error: org. freedesktop. invalid. error. serviceUnknown: The name org. gnome. sessionManager was not provided by any. service files

(Gedit: 6266): Gtk-WARNING **: Calling Inhibit failed: grule. error: org. freedesktop. invalid. error. serviceUnknown: The name org. gnome. sessionManager was not provided by any. service files

4. Set Environment Variables

# Set java environment
Export JAVA_HOME =/usr/lib/jvm/jdk1.7.0 _ 71
Export JRE_HOME =$ {JAVA_HOME}/jre
Export CLASSPATH =. :$ {JAVA_HOME}/lib :$ {JRE_HOME}/lib
Export PATH =$ {JAVA_HOME}/bin: $ PATH

5. Set the default JDK

Bkjia @ bkjia :~ $ Sudo update-alternatives -- install/usr/bin/java/usr/lib/jvm/jdk1.7.0 _ 71/bin/java 300
Update-alternatives: using/usr/lib/jvm/jdk1.7.0 _ 71/bin/java to provide/usr/bin/java (java) in automatic mode
Bkjia @ bkjia-ThinkPad-Edge-E545 :~ $ Sudo update-alternatives -- install/usr/bin/javac/usr/lib/jvm/jdk1.7.0 _ 71/bin/javac 300
Update-alternatives: using/usr/lib/jvm/jdk1.7.0 _ 71/bin/javac to provide/usr/bin/javac (javac) in automatic mode

6. Check whether JDK is successfully installed.

(1) java-version

Bkjia @ bkjia :~ $ Java-version
Java version "1.7.0 _ 71"
Java (TM) SE Runtime Environment (build 1.7.0 _ 71-b14)
Java HotSpot (TM) 64-Bit Server VM (build 24.71-b01, mixed mode)
Bkjia @ bkjia :~ $

(2) java

Bkjia @ bkjia :~ $ Java
Usage: java [-options] class [args...]
(Execution class)
Or java [-options]-jar jarfile [args...]
(Execute the jar file)
The options include:
-D32 uses a 32-bit data model (if available)
-D64 uses a 64-bit data model (if available)
-Server: Select "server" VM
The default VM is server,
Because you are running on a server computer.

-Cp <directory and Class search path for zip/jar files>
-Classpath <directory and Class search path for zip/jar files>
Separated directories and JAR files
And ZIP file list, used to search for class files.
-D <name >=< value>
Set System Properties
-Verbose: [class | gc | jni]
Enable detailed output
-Version: output the product version and exit.
-Version: <value>
The specified version is required for running.
-Showversion: output the product version and continue
-Jre-restrict-search |-no-jre-restrict-search
Include/exclude user-specific JRE in version search
-? -Help: output the help message.
-X outputs help for non-standard options
-Ea [: <packagename>... |: <classname>]
-Enableassertions [: <packagename>... |: <classname>]
Enable assertions at the specified Granularity
-Da [: <packagename>... |: <classname>]
-Disableassertions [: <packagename>... |: <classname>]
Disable assertions with a specified Granularity
-Esa |-enablesystemassertions
Enable System assertions
-Dsa |-disablesystemassertions
Disable system assertions
-Agentlib: <libname> [= <option>]
Load the local proxy library <libname>, such as-agentlib: hprof
For more information, see-agentlib: jdwp = help and-agentlib: hprof = help.
-Agentpath: <pathname> [= <option>]
Load the local proxy library by full path name
-Javaagent: <jarpath> [= <option>]
For more information about how to load Java programming language proxies, see java. lang. instrument.
-Splash: <imagepath>
Use the specified image to display the startup Screen
For more information, see http://www.oracle.com/technetwork/java/javase/documentation/index.html.
Bkjia @ bkjia :~ $

(3) javac

Bkjia @ bkjia :~ $ Javac
Usage: javac <options> <source files>
Possible options include:
-G generates all debugging information
-G: none does not generate any debugging information
-G: {lines, vars, source} only generates some debugging information
-Nowarn does not generate any warning
-Verbose outputs messages about the operations being performed by the compiler.
-Deprecation: output the source location of an outdated API
-Classpath <path> specifies the location for searching user class files and annotation handlers.
-Cp <path> specifies the location for searching user class files and annotation handlers
-Sourcepath <path> specifies the location of the Input Source file to be searched.
-Bootclasspath <path> overwrites the position of the boot class file
-Extdirs <directory> overwrites the location of the installed Extension
-Endorseddirs <directory> overwrites the location of the standard path of the signature.
-Proc: {none, only} controls whether to perform annotation processing and/or compilation.
-Processor <class1> [, <class2>, <class3>...] Name of the annotation handler to run; bypassing the default search process
-Processorpath <path> specifies the location of the comment handler.
-D <directory> specifies the location of the generated class file
-S <directory> specifies the location of the generated source file.
-Implicit: {none, class} specifies whether to generate class files for implicitly referenced files
-Encoding <encoding> specifies the character encoding used by the source file.
-Source <release version> provides source compatibility with the specified release version
-Target <release> generates class files of a specific VM version.
-Version Information
-Help: output the summary of standard options.
-Option for passing the keyword [= value] To the annotation Handler
-X outputs a feed of non-standard options
-J <tag> pass the <tag> directly to the runtime system
-Terminate Compilation When Werror is warned
@ <File Name> read from file option and file name

Install JDK 7 In Ubuntu (with Clojure download)

Install JDK 12.04 in Ubuntu

CentOS6.3 install JDK and environment Configuration

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.