Java learning is the first step on the journey

Source: Internet
Author: User
In the previous article, "Java Learning Java Environment", we learned the basic concept of the Java Runtime platform, in this article, let's look at how to install and configure the Java platform, and begin to write our first Java applet step-by-step.
 
There are many kinds of Java development platform, in this article I mainly take j2se as an example. J2SE is almost a prerequisite for developing all Java applications. It is mainly composed of a compiler (compiler), a running environment (runtime Environment), and a core API. Again, we want to emphasize that the applications you write are not executed directly on your local operating system, but are machine languages that are interpreted by the JVM (the Java Virtual machine). This is a great way to make sure you are developing on Solaris, Linux, Macintosh, or Windows and you can easily run on other environments or platforms.
First of all, I'd like you to take a look at the terminology of Java development before you download it, which may be helpful to you, I've collected some.
JDK is Java develop kit-Java development Package
J2SDK is Java 2 software develop kit--JAVA2 Software Development Kit
These two words are the two names of Java platform Development tools. At present, the more common use of J2SDK, now the version is 1.4.
The JRE is Java Runtime Environment, the Java Runtime environment is generally concentrated in j2sdk, but if you are only running Java for development purposes, you can download the JRE directly, which is now 1.4.
With these concepts, I think you will not be at a loss for J2EESDK, J2SESDK and J2MESDK.
Now we can download it. Install the program 48.30MB, the default is installed in C:, the size of 76.2MB.
If you have already installed, we have to make a small setup. Open Control Panel--〉 Advanced Settings--〉 environment variable--〉 system variable--〉path add a path. This path is the path to the Bin folder in your installation j2sdk. For example, you are installed in the D: Packing directory. Then the path should be d:j2sdk1.4.2_03in.
Everything is ready, let's start with the first Java program. This time, write a small applet that displays the results in a window. There are a lot of development tools available, and we only use Notepad this time. In future articles, we will learn how to use specialized Java tools. First, please write down this code in your Notepad. Note that Java is case-sensitive.
importjava.applet.*;
importjava.awt.*;
public class Zdnetlining extends Applet {
public void Paint (Graphics g) {
g.DrawString ("The java! of the", 150, 25);
}
}
The zdnetlining of the word class is the name of the name you have for this class, and it will be the name of the file you are saving, which is more critical. When you save a file, the suffix name needs to be in. java. For this code to be "Zdnetlining.java" it is best to enclose quotes when saving.

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.