8. Configuring the Java environment under Linux

Source: Internet
Author: User

Reprint: http://blog.sina.com.cn/s/blog_c5a35e780102wtxl.html

Biological information Many software is written in Java, so you need to configure the Java Runtime Environment on Linux. Java on the platform is a 1.7x version, but some biometric software, such as picard,trimmomatic,gatk,requires a higher-level version of Java, so the following tutorial is a detailed step to download the installation of the above 1.8x version. Note that this installation package does not require root user rights under Linux, and regular user can be installed under their own path.

Download: http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html) Download the latest Java Zip package, with the name JDK (Java development Kit) start

1, download after uploading to the folder, such as/home/user/software/java (can be done with Mkdir/home/user/software/java); 2, unzip the compressed file: Tar zxvf Jdk-8u91-linux-x64.tar.gz generationjdk1.8.0_91Folder 3. ThenConfigure environment variables: Vim ~/.bash_profile ##/etc/profile Enter the following three lines at the end of the text:export java_home=/home/gql/software/jdk1.8.0_91export PATH= $JAVA _home/bin: $PATHexport CLASSPATH=.: $JAVA _home/lib/dt.jar: $JVA _home/lib/tools.jarSave the file. SOURCE ~/.bash_profile

java_home Environment Variables ,java_home The setting of this environment variable is the installation directory of the JDK, for example, your JDK is installed in the d:/jdk1.6.0 directory , Please check if there is a subdirectory in this directory Bin,bin directory is not java.exe this file, if so, then your JAVA_HOME environment variable content should be d:/jdk1.6.0.

The classpath environment variable is when we need to refer to a class that someone else has written when developing a Java program, let the Java interpreter know where to look for the class. In general, Sun provides us with some extra rich class packages, One is Dt.jar, the other is Tools.jar, and the two jar packages are all in the C:/jdk1.3/lib directory. So we usually add these two jar packages to our CLASSPATH environment variable.

set classpath=.; C:/jdk1.3/lib/tools.jar;c:/jdk1.3/lib/dt.jar. focus on the jar package, you need to keep up with the full file path in Classpath, not just a directory. The first path of the point ".", which represents the current directory , so that when we run Java aclass , the system will first look for the AClass file in the current directory.

4. Testing

Echo $JAVA _home
Echo $PATH
Echo $CLASSPATH

Java-version

8. Configuring the Java environment under Linux

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.