Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to build Java environment

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

This article introduces the relevant knowledge of "how to build the Java environment". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

Construction of Java Environment

To run the Java program, JDK must be installed. JDK is the core of the entire Java, including the Java compiler, JVM, a large number of Java tools, and the basic API of Java.

JDK is available for download from http://Java.sun.com, version 1.4 and version 1.31. First of all, version 1.31 is used in my learning environment.

Unpack the installation. Then, set up the environment.

1. The following settings should be made for the Windows platform:

Set PATH=YOUR_INSTALL_ DIR\ bin; C:\ Windows;C:\ Windows\ Command set classpath=. ; YOUR_INSTALL_DIR\ lib\ tools.jar

two。 To edit the / etc/profile file for the Linux platform:

JAVA_HOME=your_install_dir/JDK/j2sdk CLASSPATH=$JAVA_HOME/lib/tools.jar:$JAVA_HOME/lib/td.jar:$JAVA_HOME/jr-e _ PATH=$PATH:$JAVA_HOME/bin export PATH PS1 USER LOGNAME MAIL HOSTNAME HISTSIZE HISTFILESIZE INPUTRC JAVA_HOME CLASSPATH RESIN_HOME

* enter Java on the terminal to see if you can find this command. If you can find the installation, it will be successful.

Here are some important commands for JDK:

1. Java execution tool, which is a command to start JVM (virtual machine) and execute class (BYTE CODE) files

2. Javac compiler, which generates .class files from .java files

3. Jar Java compression and packaging tool

4. Javadoc document generator.

* is JDK Documentation, which is the online help document for JDK. It is the most useful and important learning reference document and should be read more.

Start writing your own code.

Now that the environment is in place, it's time to write a simple code for testing. Or start with the classic "hello word".

1. First write a code in the editor (I use Linux's vi):

[stone@coremsg work] $vi Hello.Java public class Hello {public static void main (String [] argc) {System.out.println ("Hello Word!");}}

two。 Compile:

[stone@coremsg work] $Javac Hello.Java

3. Execute:

[stone@coremsg work] $Java Hello Hello Word!

Succeed! This is my Java program. From then on, I knew that I had started to enter the world of Java, and then I had to rely on my own efforts. In this process, the author thinks that there are several points to pay attention to.

Reference books are inseparable from learning a new language. My advice is to start looking for a short introductory book to learn the simplest and most basic things, including learning Java grammar. At the same time, you should debug the simplest program and think about what will happen if you change it. Why do you have to write that? Think more about these problems and then do it, you will have more gains. It is useful to think about it over and over again. In addition, you should read more JDK's online help at this stage and learn as much as possible about API, the Java basic class library provided by JDK.

After you have a certain foundation and can write some simple programs, you can start reading the book "Thinking in Java". It completely introduces the syntax, object-oriented features and core class libraries of Java. Through this level of learning, we can deepen the understanding of Java and the application of the underlying principles, and at the same time, we can fully understand the whole system of Java. At this stage, we should focus on learning the features of Java's object-oriented programming language, such as inheritance, constructors, abstract classes, interfaces, polymorphisms of methods, overloads, overrides, exception handling mechanisms of Java, etc., and have a very clear understanding of the above concepts. The purpose of this is to apply these techniques to practice for reasonable programming (for example, you will consider whether a class is designed with abstraction or interface, etc.). This requires that it must be applied and learned in a large number of practices. This is also the advice given to me by many of my friends.

Learn more

If you want to use Java to accomplish a variety of more powerful tasks, you need to learn more than the language.

1.Java Web programming

For Java Web programming, you should and must be familiar with and master the HTTP protocol, you can refer to the third volume of Stevens's "TCP/IP detailed explanation". Java Servlet technology provides the ability to generate dynamic Web page content, which is one of the most basic functions in your Java project, so you must learn. Through this stage of learning should be mastered Servlet/JSP Web programming.

2. Learning of J2EE

J2EE contains too many technologies. It won't be very effective if you want to sit at the table and hold a lot of books to study. I suggest that at the beginning of this stage of learning, you can follow the following steps, the general idea is "overall grasp, break one by one".

(1) understand the meaning of technical terms in J2EE.

My feeling is that there are many technologies involved in the J2EE standard, and it is unrealistic and ineffective to learn one by one in the first place. My advice is to have a general understanding of the technologies, such as EJB, JavaIDL, JTA, etc. Maybe you don't know how to write an EJB, but you need to know what EJB is and what it can do. when you have such a concept, it will be much faster to learn it purposefully. I would like to repeat that you have to do it in practice.

(2) understand the design patterns in J2EE, which can help you to have an overall grasp of J2EE.

The MVC development pattern has been proved to be one of the effective processing methods. It separates data access from data presentation. You can develop a scalable and scalable controller to maintain the entire process. Through this level of learning, when you are faced with a project, you should first grasp the design of its overall architecture and decide which technologies to adopt in the J2EE standard.

(3) understand some typical cases of J2EE platform and deepen the concept and understanding of this technology.

You can usually pay more attention to this aspect, be familiar with some typical cases, and analyze why it should use that time. What can be achieved by doing that? Then contact whether the project around you can be used as a reference.

(4) learn all kinds of techniques under J2EE.

After the first few stages of learning, you can build your own J2EE platform and start learning each technology specifically. You can participate in company-related projects to learn, or you can build your own platform for learning. At this time, you should find some relevant books to learn step by step. There are no shortcuts. If you are not satisfied with this, you should also learn more about UML, design patterns, and so on.

This is the end of "how to build a Java Environment". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report