JDK1.5.0

xiaoxiao2021-03-14  194

1. Download SDK latest version is JDK 1.5.0_06 download address: http://java.sun.com/j2se/1.5.0/download.jsp Select JDK 5.0 Update 6 Includes the JVM Technology download hypothesis installed in D: / jdk1 .5.0_06 / Directory [Default All installation, specific options] [Development Tool]: J2se Development Kit 5.0, including dedicated JRE5.0._264M [Demo]: Sample applet and application containing source code [Source code]: Source code for classes of J2SE public API [Public JRE]: Independent JRE5.0. Any application can use this JRE. This JRE registers java plugins and Java Web Start to the browser and system. You can Unload it from JDK.

There are three options during the installation process. J2se Runtime Environment in European languages ​​seems to have no choice. All is installed, anyway, 161M space [this is a new feature of JDK1.5 installation files]. Note: Select installation The directory should not be the same before. When you select D: /jre1.5.0_06. If you choose the same as the JDK installation directory, you can overwrite the previous installation file, the JDK bin directory does not find the case where the Javaac.exe file is found. After completion D: /JDK1.5.0_06/ is 188m, D: /JRE 1.5.0_06/ is 68.7m.

2. View the version enters DOS, run java -version

3. Configure environment variables [To find why you can skip this step] Because the Win system performs a command directly in the DOS to find the directory in the environment variable, you must add a directory where the command is located in the PATH. Configure environment variables. As follows: java_home: d: /jdk1.5.0_06/path:.;% Java_home% / bin; (add) Note: ClassPath does not need to be set in JDK1.3, the classpath parameter is used to point out the category The search directory of the Bytecode file.

4. Debug JDK Save the following code is HelloWorld.java, assuming saved in the following directory: E: / program / java / public class helloworld {public static void main (string [] args) {system.out.println ("Hello, World ! ");}}

Enter DOS, enter the directory E: / Program / Java /, perform the following command: E: / Program / Java> Javac HelloWorld.java ↓ 'javac' is not internal or external command, nor is the runable program or batch file.

Cause: It is easy to understand, because the current directory [E: / program / java /] is no command JAVAC. So how will the D: / jdk 1.5.0_06 / bin directory, do it? Note: At this time, helloworld. The Java file is not in the current directory.d: /jdk1.5.0_06/bin> javac e: /program/java/helloWorld.java

D: /jdk1.5.0_06/bin> The compilation is successful, generate the HelloWorld.class file in the E: / Program / Java / Directory, and then run:

D: /jdk1.5.0_06/bin> Java E: / Program / Java / HelloWorld ↓ Exception in thread "main" java.lang.noclassdeffounderror: E: / program / java / helloWorld This is not, then go to the source file directory Next: E: / Program / Java> Java HelloWorld ↓ Hello, World!

I finally saw the long-lost Hello, is it very depressed? Do you have a java program so trouble? Do you have a directory? Let's go back to step 3. After configuring the environment variable, Compile and run directly in the source file directory.

Congratulations! You can travel in the Java world later! I wish you success!

转载请注明原文地址:https://www.9cbs.com/read-129242.html

New Post(0)