How to quickly build a Java Development Environment

Source: Internet
Author: User

1. What is the difference between. Java and. class files in Java?

2. What are the roles of JDK and JRE in Java development tools?

3. In Java Development, how does JDK and JRE affect development?

4. What is the significance of system environment variable configuration in the deployment environment?

I think these questions are indeed a simple foundation, but sometimes they are ignored by us. the following is my understanding. Of course, there may be a standard answer, but I still understand it here, because it does not mean that my answers are correct.

1. What is the difference between. Java and. class files in Java?

. Java can be understood as a text file. It can be directly created and opened and edited through our notepad. Its essence is still a text file ;. class files are so-called binary files ,. the essence of class is. java files are binary. Of course, we can reverse the process by using a tool. class generation. java, of course, this will still lose part of the information, such as comments.

From the perspective of application,. Class is really needed during runtime, and its creation is from visual. java.CodeWhat we see in the design is. Java, which is used when running our code.

2. What are the roles of JDK and JRE in Java development tools?

I am not clear about the so-called JDK and JRE. I simply sum up the two with JDK. java and. the bridge between class changes. JDK can set the Java syntax and generate the compiled. in essence, if we want to write a Java language file, we can write it directly in notepad. java, but if you want. java. to install JDK. as for jre, it is usually bundled with JDK, and the translation of JRE should be a Java Runtime Environment, which should be called a Java virtual machine ,. if you want to run the class, you must rely on JRE. from. from the class perspective, JDK is the creator and JRE is the operator.

3. In Java Development, how does JDK and JRE versions affect development?

There are indeed many different versions of JDK and JRE. If we develop a J2EE project, I feel that for some older code workers, they are pursuing a stable fit, jdk1.4.2 may be used. If you are a programmer looking for trendy technologies, it may be the latest jdk5. You can download and install these two jdks. in addition, if you want to install the installation, we recommend that you do not use the default directory for installation. It should be installed in a directory such as D:/jdk1.4.2, the most basic principle is that the directory name is in English and there is no space. If you need to configure the environment variable, the name can be easily used for batch processing.

4. What is the significance of system environment variable configuration in the deployment environment?

The configuration of system environment variables is available in almost all Java syntax tutorials. If you use JDK and notepad for direct development, you should enter them honestly, but the meaning will not be great. you can try to locate the command line cmd to the bin directory of your JDK, and then enter the javac and Java commands, so the same effect will be achieved, therefore, the environment variable configuration in the syntax tutorial only plays a convenient role (you do not need to switch to the JDK directory). In fact, you only need to install JDK, environment variable configuration is not very important for IDE development.

I believe that as long as I understand the above questions (of course, the answer is not necessarily the same as mine, I am just a rough summary or even an inaccurate or wrong place ), you can see why JDK needs to be installed.

Now that I have said so much, let me introduce the effective practices of Java Development Environment deployment.

1. Select the right IDE--ECLIPSE

First of all, I do not recommend notepad development. The efficiency is too low. I can only use some syntaxes for classroom teaching and training. I recommend using IBM's open-source development tool eclipse to develop JavaProgramIn fact, the demo program is jbulider when I teach the syntax in school, but after work, I found that the eclipse penetration rate is quite high. It can be seen that eclipse is a very good development tool. of course, what attracts me most is that eclipse can use a Chinese interface. Although it has the advantages of English, we are all Chinese, facts have proved that the proper IDE can effectively improve the development efficiency, which may be 30%-50% (as shown in the Code Daquan). Therefore, we should also use eclipse to help users use Chinese characters, besides, it is still open-source and free. there may be other good ides, but since I have never used it, I will not mention it.

2. Select the appropriate version of eclipse

If you are a newbie, I suggest you use eclipse3.2.1. as for the reason, you don't need to mention it. This is the highest Chinese version, so we will use eclipse3.2.1. if you are familiar with Eclipse, or have good English, you can also use the latest eclipse3.3. * version. But note that I suggest you select the purest version when downloading it, it should be the eclipse classic version, because eclipse requires extension of functions through plug-ins, because the requirements are complex, so it is easier to use the simplest version for future extension.

When downloading the Windows version, it will be OK. If you have a language pack, you are advised to download it together so that you can use Chinese. Haha.

3. What are the requirements for using eclipse?

The write requirements for eclipse3.3.1 are:

You will need a Java Runtime Environment (JRE) to run eclipse classic. A Java 5 JRE is recommended.

The reason is that it is written in Java with eclipse. Therefore, Java programs must rely on JRE for use. Therefore, you must first install JDK and then JRE will be installed together. there are no other requirements. as for the JDK version, it seems that JDK 5 is required for eclipse3.3, and JDK 1.4.2 is required for the original version at least. Therefore, it is absolutely no problem to install JDK in the two versions I recommended earlier.

In addition, the most important thing for eclipse is to install JRE in the operating system. It doesn't matter if JDK is installed. JDK is just a green copy file.

4. Install the Eclipse plug-in

This is another important issue. in some eclipse tutorials, we recommend that you download the plug-in zip and copy all the files to pulgs. this is not recommended, because if you have installed n plug-ins, there will be problems. The most obvious example is to overwrite the language plug-ins first, and then overwrite a lomboz, then an error may be reported, and the English version of eclipse is finally generated. The cause may be that all plug-ins are designed according to the pure version of Eclipse, this method is not recommended because it is not pure after each coverage.

Another method is to update the website through the eclipse update system, which may improve compatibility, but is not recommended, so it is not detailed.

The last method is the links method. assume that your eclipse files installed in D:/release are released to the language directory. Release the eclipse folder in the compressed file instead of the small folder. after the release, the language file package is stored on the hard disk. The following describes how to use eclipse to call the language file package plug-in. enter D:/Eclipse/links and create a new extension named. to facilitate management, the Language Pack link is named language. start, and set the text content in the file to Path = D: // eclipse // pluginbyme // language. If you want to use other plug-ins later, that is, create a plug-in folder in pluginbyme, release the compressed package, and create a new links according to the content. in this way, the plug-in can be effectively used, and it will no longer be annoying. I thought I had spent a lot of time doing this.

5. How many plug-ins are required?

Eclipse has rich plug-in resources. If you need it, you can install it. Of course, we can choose a typical plug-in installation, such as myeclipse. This software is a commercial software, so you have to pay for it, however, we usually use calculation numbers for development. So .... let's just talk about it. But we need to support genuine products. In fact, if the level is high, we don't need to develop such commercial software, or even develop open-source plug-ins on our own. Of course, this is not the case.

For myeclipse, the same integrated version and plug-in version are available. I recommend the plug-in version because the integrated version may be faulty, and the plug-in version is basically no problem. so select a smaller plug package during the download, and then select your eclipse installation directory as prompted. This completes the installation and does not affect your localization (this is my purpose, long live Chinese !)

Of course, if you want to use the myeclipse function, you need to enter the registration code. At this time, I will not talk about it. Let's take a look at it.

Of course, from the perspective of pure installation, we can finally create a green myeclipse installation package, but we haven't tried it yet. If you are interested, you can refer to otherArticle.

6. Can I develop a Java program now?

In theory, this is actually the case. once the eclipse program can run, it will automatically find the JRE registered on your machine. This should be a registry mechanism. After jdk5 is installed, JRE may be 5, so eclipse will automatically set JRE to 5. if JRE is not installed? As mentioned above, eclipse cannot be started at all. Therefore, if eclipse can be started, it can be run naturally. As for the JDK compiler, IDE will automatically choose it, I guess this compiler has nothing to do with the compiler we installed on the system. Eclipse's own ide has the JDK compilation capability. Of course, you have to choose the JDK version jdk1.3 by yourself, jdk1.4, jdk5, jdk6. (note that the compiler and JRE versions are best consistent ). of course, JDK 5 and jre5 may be installed by default, so there is no need to worry about it. However, because we have installed two JDK versions, we need to convert them in some cases, we recommend that you retain JDK 5 as the standard by default. the most important thing is the consistency between the compiler and the JRE version !!!

As a matter of fact, there is still much work to be done for development, but now the configuration is basically complete, so now you have to write Java code. the level of the article may be relatively low, but I hope to help those who are at a low level. cainiao will help each other. If you have suggestions on the content of the article, please write a comment directly, I will try to modify it.

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.