May 10, 2021 Java
1. The window system installs java
2. Linux, UNIX, Solaris, FreeBSD environment variable settings
Java development environment configuration
In this section, we'll show you how to build a Java development environment.
First we need to download the java development kit JDK, download address: http://www.oracle.com/technetwork/java/javase/downloads/index.html
Click on the download button below:
On the download page you need to choose to accept the license and select the appropriate version based on your own system, using the Window 64-bit system as an example:
After downloading, the installation of JDK according to the prompts, as well as the installation of JDK will also install JRE, installation on it.
By installing the JDK, we can customize the installation directory and other information during the installation process, for example, we chose to install the directory as C:\Program Files (x86)\Java\jdk11.0.1.
1. Right-click "My →" → "Advanced System Settings→ "Advanced" → "Environment Variables";
4. Io, the new "CLASSPATH" system variable, the variable value
“.;%JAVA_HOME%\lib;%JAVA_HOME%\lib\dt.jar;%JAVA_HOME%\lib\tools.jar;”
。
(All the contents of the quotation marks, note that the front is the point is not a comma)
5. Double-click the Path variable under System Variable to edit.
(You can see JAVA_HOME already exists in the system variables), (some computers "Path" also write "PATH")
This is the java environment configuration, after the configuration is complete, you can start Eclipse to write code, it will automatically complete the java environment configuration.
Set 3 properties in System Variables, JAVA_HOME, PATH, CLASSPATH (case does not matter), click Edit if it already exists, click New if it does not exist.
The variable setting parameters are as follows:
Note: If you use a version of JDK with more than 1.5, you can compile and run the Java program normally without setting the CLASSPATH environment variable.
1, at the same time press the keyboard "win", "R" two keys to open the run, enter "cmd" to determine the opening of the console.
2, type commands: java -version, java, javac several commands, the following information appears, indicating that the environment variable configuration is successful;
The environment variable PATH should be set to point to the location where the Java binary is installed. If you're having trouble setting up, refer to the shell documentation.
For example, if you use bash as shell, you can add the following to the end of your .bashrc file: export PATH=/path/to/java:$PATH
Is the so-called work to do good things must be first al-Algeoli, we also need a good development tool in the process of developing java language, the current market IDE a lot, this article recommends the following java development tools:
Eclipse (recommended): Another free open source java IDE, download address: https://www.eclipse.org/eclipseide/
Choose Eclipse IDE for Java Developers:
HelloWorld .java file code:
public class HelloWorld {
public static void main(String []args) {
System.out.println("Hello World");
}
}