Installation, configuration, and use of Java toolkit

Source: Internet
Author: User
1. Download j2sdk 1.4.1 or later (http://java.sun.com, it is recommended to download its Java Documentation, which is the Java help Documentation)
2.run the newly downloaded j2sdk-00004_000002-windows-i586.exe file for formal installation (The following is assumed to be installed in c: j2sdk1.4.1. We recommend that you do not have spaces in the installation path. It is not suitable to be installed in the Program Files directory !).
3. Set the runtime environment parameter: a. If it is Win95/98, add the following three lines at the end of autoexec. bat:
Set JAVA_HOME = c: j2sdk1.4.1
Set PATH = % JAVA_HOME % in; % PATH %
Set CLASSPATH =.; % JAVA_HOME % lib
Note: run the doscommand notepad c: autoexec. bat to open notepad and add the preceding three statements.
B. If it is Win2000, use xp to right-click "My Computer"-> Properties-> Advanced-> environment variables
System variable-> New-> variable name: JAVA_HOME variable value: c: j2sdk1.4.1
System variable-> New-> variable name: CLASSPATH variable value:.; % JAVA_HOME % lib
System variable-> edit-> variable name: Path is added at the beginning of the variable value: % JAVA_HOME % in;
(CLASSPATH has an English ending "." followed by a semicolon, indicating the meaning of the current path)
4. Use a text editor (for example, edit.com/ul /ultraedit/editplus) to write the following code and save it as a file: HelloWorld. java (the case must be correct! Suppose it is c: estHelloWorld. java)
<CCID_NOBR>
<CCID_CODE>/* HelloWorld. java */
Public class HelloWorld {
Public static void main (String arg []) {
System. out. println ("Hello, World! ");
}
} </CCID_CODE> </CCID_NOBR>
5. Open a DOS window. CD (that is, jump to/Change Directory) to the Directory where HelloWorld. java is located.
C:> cd est
C: est> _
6. Compile HelloWorld. java as HelloWorld. class.
C: est> javac HelloWorld. java
7. Run HelloWorld. class
C: est> java HelloWorld

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.