Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to configure the JDK environment

2025-01-30 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

This article mainly shows you "how to configure the JDK environment", the content is easy to understand, clear, hope to help you solve your doubts, let the editor lead you to study and learn "how to configure the JDK environment" this article.

Installation J2SDK for JDK environment configuration:

Go to the official SUN site (http://java.sun.com)) to download the installation file of J2SDK: j2sdk-1_4_2_04-windows-i586-p.exe, and install J2SDK after downloading. After installation, set the environment variable: my computer-properties-advanced-- environment variable

Select-system variable (S):

Settings for JDK environment configuration JAVA_HOME environment variables:

Click-New, and enter: JAVA_HOME in the variable name

Enter: d:\ Java in the variable value

(suppose J2SDK is installed in the directory D:\ Java, which is the directory where J2SDK is installed anyway.)

Then-make sure that the JAVA_HOME environment variable has been set up at this point.

Settings for JDK environment configuration CLASSPATH environment variables:

Click-New, and enter: CLASSPATH in the variable name

Enter: d:\ Java\ bin;.;D:\ Java\ lib;D:\ Java\ lib\ dt.jar;D:\ Java\ lib\ tools.jar in the variable value

The period in the middle. And semicolons ";" are essential.)

Then-make sure that the CLASSPATH environment variable has been set up at this point.

Settings for JDK environment configuration PATH environment variables:

Click-New, and enter: PATH in the variable name

Enter: d:\ Java;.;D:\ Java\ bin in the variable value

The period in the middle. And semicolons ";" are essential.)

Then-make sure that the JAVA_HOME environment variable has been set up at this point.

After the three environment variables are set, write a simple java program to test whether J2SDK has been successfully installed:

Create a new directory test; under D:\ and write the following program:

Public class Test {public static void main (String args []) {System.out.println ("This is a test program.");}}

Save the above program as a file named Test.java and save it in the directory D:\ test.

Detection of JDK environment configuration:

Open a command prompt window, cd to your test directory, and type the following command

Javac Test.java

Java Test

At this point, if you see the printed This is a test program. It means the installation is successful.

If this sentence is not printed out, you need to check your configuration carefully.

These are all the contents of the article "how to configure the JDK Environment". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report