First day of Java

Source: Internet
Author: User

Java is a cross-platform

Java cross-platform, in fact, whether you develop on that platform, you can run on any platform. For example, if you're developing in a Linux environment, he doesn't need to make any changes to put it on the Xp,vista, or the Apple platform to run. This is the cross-platform of Java. And the thing that can support his cross-platform is the JDK. The Linux platform uses a Linux JDK, and Apple has a dedicated JDK for Apple. The only thing that actually runs is the JRE.

Environment Building in Java
Install the JDK first, then configure the environment (no JDK or don't leave the mailbox I, send you)
The configuration environment steps are as follows:
First right click on My Computer and open properties. Then select "Environment Variables" in "Advanced", in the new open interface system variables need to set three properties:
"Java_home", "path", "Classpath"
Where the JDK is not installed, the path attribute is already present. and Java_home and classpath do not exist.
First in the "Administrator user variable" area point "new", and then in the variable name write on Java_home, which means Java installation path, hehe, and then in the variable value to write the path just installed "C:\Program files\java\ Jdk1.6.0_10 "(without quotation marks)
Next in the "System variables" find path, and then click Edit, (there are many, but do not delete them!!!!!! )
The meaning of the path variable is that the system can recognize the Java command under any path,
Insert "C:\Program Files\java\jdk1.6.0_10\bin" at the front of the original; (without quotation marks), here "C:\Program files\java\jdk1.6.0_10" cannot be replaced by "%java_home%", the specific reason I do not know
Finally, in the "System variables" area point "new", write classpath on the variable name, the meaning of this variable is the Java load Class (classes or Lib) path, only the class in Classpath, the Java command can be recognized.
Its value is ".; %java_home%\lib\tools.jar;%java_home%\lib\dt.jar; " (without quotation marks)
When the above three variables are set, press "OK" (don't forget to make sure!) hehe) until the Properties window disappears, it is verified to see if the installation was successful.
First open start, run, enter "cmd", enter
Then hit "Java-version" if the installation was successful. The system displays the version information for Java.

Note:
Also can not build java_home, but all appear "%java_home%" place to complete "C:\Program files\java\jdk1.6.0_10"
First Java language
public class Hallowrold
{
public static void Main (STRING[]AGRS)
{
System.out.println ("hallowrold!");
}
}

First day of Java

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.