Home IT Linux Windows Database Network Programming Server Mobile  
           
  Home \ Linux \ Ubuntu 15.04 installed JDK and configured as the default JDK     - PHP with FastCGI and mod_php Comments (Server)

- Git uses a standard process (Linux)

- AngularJS - Getting Started with Routing (Programming)

- CentOS yum source as the default setting methods in DVD (Linux)

- impdp error ORA-31631, ORA-39122 (Database)

- The difference between statement and preparedStatement of the jdbc (Database)

- Apache Tomcat integration and resin (Server)

- Python2.7.7 source code analysis (Programming)

- Struts2 Result Types (Programming)

- Git / Github use notes (Linux)

- CentOS install SystemTap-2.6 (Linux)

- Binary search and modification (Programming)

- How to manage start-up applications in Ubuntu (Linux)

- Struts2 : combobox label use (Programming)

- Install the latest ATI / Nvidia graphics driver on Ubuntu (Linux)

- php How to prevent being injected (Linux)

- Linux Network Security Tips Share (Linux)

- Sleuth Kit: used to analyze a disk image and restore files open source forensics tools (Linux)

- Fedora 23 How to install LAMP server (Server)

- Python kills corresponding process according to pid (Programming)

 
         
  Ubuntu 15.04 installed JDK and configured as the default JDK
     
  Add Date : 2017-01-08      
         
       
         
  Ubuntu install JDK

System versions: Ubuntu 15.04 x64
JDK version: jdk-8u60-linux-x64

1. Check the system-digit, enter the following command to

getconf LONG_BIT

2. Download the file corresponding to the JDK, I am here to download the jdk-8u60-linux-64.tar.gz

3. Create a directory as the JDK installation directory, select the installation location here is: / usr / java /

sudo mkdir / usr / java

4. Unzip the file with / under usr / java / directory, file download location is in the download directory

cd download
sudo tar zxvf jdk-8u60-linux-x64.tar.gz -C / usr / java /

5. Go to / usr / java / directory, to rename the folder (this step is not necessary, but in order to facilitate the configuration environment variable, it is recommended to do so)

cd / usr / java /
sudo mv jdk1.8.0_60 jdk_8u60

6. Configure the system environment variables

sudo gedit / etc / environment

Incorporate the following red font

PATH = "/ usr / local / sbin: / usr / local / bin: / usr / sbin: / usr / bin: / sbin: / bin: / usr / games: / usr / local / games: $ JAVA_HOME / bin"
export CLASSPATH =:. $ JAVA_HOME / lib: $ JAVA_HOME / jre / lib
export JAVA_HOME = / usr / java / jdk_8u60

After editing Save and Close, enter the following command to make the environment variables to take effect

source / etc / environment

7. Use the echo command to check the configuration of environment variables

echo $ JAVA_HOME
Output / usr / java / jdk_8u60
echo $ CLASSPATH
Output:. / Usr / java / jdk_8u60 / lib: / usr / java / jdk_8u60 / jre / lib
echo $ PATH
Output / usr / local / sbin: / usr / local / bin: / usr / sbin: / usr / bin: / sbin: / bin: / usr / games: / usr / local / games: / usr / java / jdk_8u60 / bin

8. Review the installation version:

java -version
Picked up JAVA_TOOL_OPTIONS: -javaagent: /usr/share/java/jayatanaag.jar
java version "1.8.0_60"
Java (TM) SE Runtime Environment (build 1.8.0_60-b27)
Java HotSpot (TM) 64-Bit Server VM (build 25.60-b23, mixed mode)

9. Set the environment variable for all users, or after the restart still can not find the java command

sudo gedit / etc / profile

Add the following to (Note Replace Path):

#set Java environment

JAVA_HOME = / usr / java / jdk_8u60
export JRE_HOME = / usr / java / jdk_8u60 / jre
export CLASSPATH =:. $ JAVA_HOME / lib: $ JRE_HOME / lib: $ CLASSPATH
export PATH = $ JAVA_HOME / bin: $ JRE_HOME / bin: $ PATH

10. Restart the computer, the configuration.

11. In the end? No! ! !

If Myeclipse and other IDE or install multiple versions of jdk please continue to look down

12. Modify the default JDK (Note Replace Path)

sudo update-alternatives --install "/ usr / bin / java" "java" "/ usr / java / jdk_8u60 / bin / java" 300
sudo update-alternatives --install "/ usr / bin / javac" "javac" "/ usr / java / jdk_8u60 / bin / javac" 300
sudo update-alternatives --install "/ usr / bin / javaws" "javaws" "/ usr / java / jdk_8u60 / bin / javaws" 300

These are the establishment of links to different commands, if multiple paths exist JDK only need to replace the re-run it again to create a link, execute the following command to select the link if every option is only set up a link, the system does not provide the option, if it exists a plurality of links, if necessary, select different options

sudo update-alternatives --config java
sudo update-alternatives --config javac
sudo update-alternatives --config javaws
     
         
       
         
  More:      
 
- Linux basic introductory tutorial ---- simple text processing (Linux)
- ElasticSearch - Basic Concepts (Server)
- Install apr support for Tomcat on Linux (Server)
- CentOS yum source configuration (Linux)
- Java open source monitoring platform Zorka basic use (Linux)
- Examples of testing and installation Mesos on CentOS (Linux)
- Custom Android UI template Comments (Programming)
- Understanding Linux firewall Iptables (Linux)
- Root of AVL Tree- achieve balanced search trees AVL tree (Programming)
- MySQL In can not be overridden with an internal connection (Database)
- Apache2.4.7 make an error [exports.lo] Error 1 Solution (Server)
- Oracle TDE transparent data encryption (Database)
- Use read command to read user input (Programming)
- Intruder tools Knark Analysis and Prevention Linux environment (Linux)
- CentOS 6.4 dial-up Raiders (Linux)
- Binary tree and some basic operations with binary list (Programming)
- Based shell: using read, the command-line script to achieve mass participation and input two integer calculation (Programming)
- CentOS terminal display Chinese (Linux)
- Python implementation restart the router (Programming)
- Linux using TCP-Wrapper Service Management (Linux)
     
           
     
  CopyRight 2002-2016 newfreesoft.com, All Rights Reserved.