Virtual Machine Linux ---- Ubuntu1204 ---- install jdk1.8, ubuntu install jdk1.8

Source: Internet
Author: User

Virtual Machine Linux ---- Ubuntu1204 ---- install jdk1.8, ubuntu install jdk1.8

1. Introduction

Here we will mainly talk about how to install jdk1.8 using the compressed package in Ubuntu1204 and run the rpm directly.

2. Steps

Download 2.1

Address: http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-%3151.html, download the 64-bit compressed package in linuxenvironment, jdk-8u45-linux-x64.tar.gz

Upload 2.2

You can use the xftp tool to copy files to the linux environment. Here, I put them in my own directory. Note that you may be prompted that you do not have the permission to upload files. Just grant the folder write permission.

2.3 decompress

Tar-zxvf jdk-8u45-linux-x64.gz # The directory after decompression is:/app/programs/jdk1.8.0 _ 45

2.4 configure Environment Variables

vi /etc/profile

Add the following code at the bottom of the file:

#set java environmentexport JAVA_HOME=/app/programes/jdk1.8.0_45export JRE_HOME=${JAVA_HOME}/jreexport CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/libexport PATH=${JAVA_HOME}/bin:$PATH

Save and exit.

2.5 make the configuration file take effect (sometimes the execution may fail. Restart is recommended)

source /etc/profile

2.6 Test

java -version

If the jdk version information is output, it indicates that the jdk version is successful.

  

 

    

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.