JAVA environment variable configuration in windows and UNIX/LINUX

Source: Internet
Author: User

I. Introduction to the configuration of the first few language terms: 1.JDK: java Development Kit install JDK src.zip is the java class library source code jdk bin: binary file binary jdk lib: library File libary 2.JRE: Java Runtime Environment lib/rt. jar is the core java class library 3.JVM: Java Virtual Machine 4.GC: java memory garbage collection mechanism. It is also called lazy's lazy collection mechanism. When the JVM finds that the memory is insufficient, it starts the GC thread to recycle system garbage, the GC thread is 5.API: Application Programming Interface java refers to JavaDoc API documentation 6.IDE: integrated development environment, it can be used to edit, compile, debug, run, deploy, package, and integrate other components (database programming, server components, and browsers). 2. Relationship between JDK, JRE, and JVM: (Inclusion relationship) 1. you can install JDK. Everything is available. It can provide Java development function 2. only JRE can be installed. At this time, only Java programs can be run, and compilation and debugging tools cannot be provided. JVM cannot be installed independently and must be attached to JRE. 3. environment variable configuration in Windows: 1. java installation directory, which is provided to third-party software using JAVA_HOME = C: \ Program Files \ Java \ jdk1.6.0 _ 10 2. the search PATH of the Java command (search from the past to the next, until found) path (PATH) = % JAVA_HOME % \ bin; % PATH %; 3. java class search path before JDK5.0: classpath = .; c: \ Program Files \ Java \ jdk1.6.0 _ 10 \ lib \ dt. jar; C: \ Program Files \ Java \ jdk1.6.0 _ 10 \ lib \ tools. jar; after JDK5.0: classpath =. 4. use javac or jav A-version Verification 4. Environment variable configuration in Unix/Linux: 1. first enter bash shell 2. modify in the main directory. bash_profile file. If the permission is insufficient, use the chmod command to change the permission JAVA_HOME =/opt/jdk1.6.0 _ 10. The permission must be in uppercase: PATH = $ JAVA_HOME/bin: $ path classpath =.: export JAVA_HOME path classpath 3. save and exit, and use source. bash_profile enables the environment variables to take effect. Use the echo or set command to verify whether the environment variables are configured. Use javac or java-version to verify that this is the java environment variable I configured in two different systems, hope to help some people who want to learn!

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.