Précis-Writers of Java environment variables

Source: Internet
Author: User

1, install version of JRE or JDK. You do not need to manually configure any Java environment variables after installation if you do not use it for development purposes only as a Java runtime environment.

2, Green Unzip version (copy version) JDK or JRE. The environment variables need to be configured for both running and development.

Running Java precompiled Class program needs to find Java.exe, the development Java program compiled Java files need javac.exe, so configure path to%java_home%/jdk/bin directory.

Java_home is because Tomcat uses the environment variable when the runtime is started.

3, environment variable setting,java_home,path append%java_home%/jdk/bin. No need to configure Classpath, no additional%java_home%/jdk/jre/bin required. Because there are few cases of using manual Java files, and then command-line compilation of Java source files, mature IDE, etc. have classpath default configuration.

4, reference.

This article from: http://blog.csdn.NET/han_dongwei/article/details/7782771

It is certain that when installing the JDK there will be a choice of whether or not to install a separate JRE, which will generally be installed together, and I recommend that you do so.
Because it will help you figure out the difference:

The Jre is the Java Runtime Environment, which is the operating environment of the Java program. Since it is running, of course, to include the JVM, which is familiar with the virtual machine, as well as all the Java library class files, are packaged in the Lib directory into a jar. You can verify it yourself.   As to which file is the virtual machine on Windows? Learn MFC all know what is DLL file, then we look at jre/bin/client inside there is not a jvm.dll it? That's the virtual machine.

The JDK is Java Development Kit, a Java SDK that contains a variety of class libraries and tools.     And, of course, another JRE. So why do we include another JRE?   Also, Jdk/jre/bin has both client and server two folders that contain a jvm.dll. Description is available for two virtual machines. Do we not know if we have noticed this point?

We all know that the JDK under the bin has a variety of Java programs need to use the command, and the JRE Bin directory is the most obvious difference is the JDK under the Javac, this is very well understood, because the JRE is only a running environment. It is not related to development, and because of this, the JDK with the development functionality will have both a client-nature JVM and a server-nature JVM under its own JRE, and only the jvm.dll of the client-only environment under the runtime will suffice.

Remember to set the Jdk/bin path in the environment variable path? This should be the first step for everyone to learn Java, the teacher will tell you not to set the words Javac and Java is not used. It is true that all commands are contained under the Jdk/bin directory. But has anyone thought that the Java commands we use are not in the Jdk/bin directory but in the Jre/bin directory? Do not believe you can do an experiment, you can put the Jdk/bin directory Java.exe cut to another place to run the Java program, found what? All ok!

So someone's going to ask? I did not set the Jre/bin directory into the environment variable ah?

Imagine if Java in order to provide for the majority of users, they do not need to develop the JDK, only the JRE can let the Java program run up, then each customer also need to manually set the environment variable how much trouble ah? So when installing the JRE, the installer automatically helps you to add the Java.exe of the JRE to the system variables, the verification method is very simple, we see the system environment variable path at the front of the "%systemroot%\system32;%systemroot%;" Such a configuration, then go to windows/system32 below to see it, found what? There is a java.exe.

If you force the ability to move Jdk/bin to the system32 variable, you can certainly force the use of Java in Jdk/jre, but I don't recommend it unless it's necessary. Running a Java program with a separate JRE is also a test in a customer environment.

So you should know more about the connections and differences between the JDK and the JRE?

Précis-Writers of Java environment variables

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.