search
HomeJavaJavaBaseHow to configure java

How to configure java

Nov 19, 2019 pm 04:54 PM
java

How to configure java

window system installation java

Download JDK

First we need to download the java development tool kit JDK, download address: http://www.oracle .com/technetwork/java/javase/downloads/index.html, click the download button as follows:

How to configure java

In the download page, you need to choose to accept the license and adjust it according to your system Select the corresponding version. This article takes the Window 64-bit system as an example:

How to configure java

After downloading, install the JDK according to the prompts. When installing the JDK, the JRE will also be installed. and install it.

Install JDK. During the installation process, you can customize the installation directory and other information. For example, we choose the installation directory as C:\Program Files (x86)\Java\jdk1.8.0_91.

Configure environment variables

1. After the installation is complete, right-click "My Computer", click "Properties", and select "Advanced System Settings";

How to configure java

2. Select the "Advanced" tab and click "Environment Variables";

How to configure java

Then the following will appear: Screen:

How to configure java

Set 3 properties in "System Variables", JAVA_HOME, PATH, CLASSPATH (case does not matter), if it already exists, click "Edit", no If it exists, click "New".

Note: If you use JDK version 1.5 or above, you can compile and run Java programs normally without setting the CLASSPATH environment variable.

The variable setting parameters are as follows:

  • Variable name: JAVA_HOME

  • Variable value: C: \Program Files (x86)\Java\jdk1.8.0_91 // Configure according to your actual path

  • Variable name: CLASSPATH

  • Variable value: .;%JAVA_HOME%\lib\dt.jar;%JAVA_HOME%\lib\tools.jar; //Remember there is a "." in front

  • Variable name: Path

  • Variable value: %JAVA_HOME%\bin;%JAVA_HOME%\jre\bin;

JAVA_HOME Settings

How to configure java

How to configure java

##PATH Settings

How to configure java

How to configure java

CLASSPATH setting

How to configure java

This is the Java environment configuration. After the configuration is completed, you can start Eclipse to write code and it will automatically Complete the configuration of the java environment.

Test whether the JDK is installed successfully

1. "Start"->"Run", type "cmd";

2. Type the command : java -version, java, javac several commands, the following information appears, indicating that the environment variable configuration is successful;

How to configure java

Linux, UNIX, Solaris, FreeBSD environment variable settings

The environment variable PATH should be set to point to the location where the Java binaries are installed. If you have trouble setting up, please refer to the shell documentation.

For example, assuming you are using bash as your shell, you can add the following to the end of your .bashrc file: export PATH=/path/to/java:$PATH

More For java knowledge, please pay attention to

java basic tutorial.

The above is the detailed content of How to configure java. For more information, please follow other related articles on the PHP Chinese website!

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

SublimeText3 Linux new version

SublimeText3 Linux new version

SublimeText3 Linux latest version

Dreamweaver Mac version

Dreamweaver Mac version

Visual web development tools

ZendStudio 13.5.1 Mac

ZendStudio 13.5.1 Mac

Powerful PHP integrated development environment

SecLists

SecLists

SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)