Learning the meaning and method of JAVA language

A, JDK (Java Development Kit)

JDK is the core of the whole Java, including the Java Runtime Environment (Java Runtime Environment), a bunch of Java tools and Java basic class library (rt.jar) . No matter what Java application server is essentially built-in a version of the JDK .

JDK JRE JVM

JVM (Java virtual machine) Java Virtual Machine, which is essentially a JRE contains the JAVA dynamic link library .

Students to understand the JDK, JRE, JVM and JAVA's internal mechanisms can refer to & lt; Huazhong University of Science and Technology Publishing House published by Wang Sen, written & lt; Java depth of adventure & gt;.

The use of JDK: JDK is also called J2SE (Java2 SDK Standard Edition), can be downloaded from Sun's Java Web site, download the JDK is an executable installer, the default installation will be completed after the installation of a set of directory in C:\Program Files\Java\ installation of a JRE (for the browser to use), in the C:\Program Files\Java\ directory, in the C:\Program Files\Java\ directory to install a set of JRE (for the browser to use). browser to use), in C:\j2sdk1.4.2 under the installation of a set of JDK (also includes a set of JRE). Then we need to add the java path C:\j2sdk1.4.2\bin to the top of the environment variable PATH. This way the JDK is installed.

JDK's most important command-line tools: java: start the JVM to execute class javac: Java compiler jar: Java packaging tools javadoc: Java Documentation Generator

second, JDK Documentation

Documentation is the most important Programming Manual, covering the entire Java all aspects of the content of the description. You can say this, learning Java programming, most of the time is spent reading this Documentation above. I carry it with me and check it anytime I write Java code . It has a detailed explanation of any CLASS, including the inheritance relationship of the class , which interfaces are implemented , usually used in which occasions , as well as its PUBLIC attributes and methods , as well as the application of the method , the description of the parameters in the method , the type of return value , thrown exceptions and so on .

So students on the DOCUMENTATION of the study is particularly important

Three, application servers (App Server)

App Server is running Java enterprise components of the platform, constituting the main operating environment of the application software. The current mainstream App Server is BEA's Weblogic Server and IBM's Websphere as well as free Jboss, choose one of them to learn.

Tomcat :Strictly speaking is not a real App Server, it is just a support for running Serlvet/JSP Web container , but Tomcat also extends some of the functions of the App Server , such as JNDI, database connection pooling, user transactions and so on . Tomcat is an Apache organization under the Jakarta project under a sub-project, its main website is: http://jakarta.apache.org/tomcat/ , download and run it after the .EXE file, and set two system environment variables:

JAVA_HOME=C:\j2sdk1.4. 2

CATALINA_HOME=D:\tomcat4 (Tomcat installation directory)

After installation, start Tomcat and run CATALINA_HOME\bin\startup.bat, and close Tomcat and run the shutdown.bat script. Afterward, port 8080 is used by default, so you can access http://localhost:8080来测试Tomcat是否正常启动 with a browser.

Four, Java applications running environment

1, Java's desktop applications

Desktop applications generally only need JRE support is enough.

2, Java Web applications Java Web applications at least need to install the JDK and a web container (such as Tomcat), and a multi-user database , Web applications are divided into at least three tiers : Browser layer : the browser displays the user page Web layer : running Servlet/JSP DB layer : the back-end database to provide data access to the Java program . Java enterprise applications

3, enterprise applications are more complex, can be extended to n-tier, the simplest case will be divided into four tiers: Browser layer: the browser displays the user's page Client layer: Java client graphics program (or embedded device programs) directly interact with the Web tier or EJB tier Web tier: running Servlet/JSP EJB tier: the user's page is displayed on the browser. Servlet/JSP EJB layer: running EJB, to complete the business logic operation DB layer: back-end database, to provide data access services to the Java program

4.MVCModel view controller) Model layer: the realization of the system's business logic, usually can be implemented using JavaBean or EJB. The view layer: used to communicate with the system. View layer: used to interact with the user, usually realized with JSP. ? Controller layer: is the communication bridge between Model and View, it can assign the user's request and select the appropriate view for display, at the same time it can also interpret the user's input and map them to the model layer can be executed.

2. Java Learning Path (2), books

Introduction recommended:

Electronic Industry Publishing House, "Java 2 Programming Explained" or "Java 2 from the Beginner to Master"

Thinking in Java book is not a complete introduction to the entire system of Java, but a jump in the writing method.

Thinking in Java is not a complete introduction to the whole system of Java, but a jumping method of writing, is a method similar to tips to Java many knowledge points in-depth analysis and explanation.

Personal recommendation: Electronic Industry Publishing House's "Java 2 Reference Book"

The real most useful: JDK's Documentation

The most important is the API documentation of the Java base library (package to organize )

Documentation is also a must-have programming manual :

The JDK's Documentation

The JDK's Documentation

Documentation is also a must-have programming manual. Documentation :

1. Documentation for J2SDK1.4.2

2. Documentation for Servlet2.3

3. Documentation for J2SDKEE1.3.1

Java Web Programming Books:

O'Reilly's "Java Server" is a great example of a Java Web program. >Oreilly's "Java Server ages" or Electronic Industry Publishing House's "JSP from Beginner to Master"

For Java Web Programming, the core is to be familiar with and master the HTTP protocol, which has nothing to do with Java, after familiarizing themselves with the HTTP protocol, you need to familiarize themselves with Java's implementation of the HTTP protocol class library, that is, the Servlet API, which is the first time the Java Web programmer has ever used the HTTP protocol. , that is, the Servlet API, so the most important thing is the Servlet API for beginners, directly through the Servlet API to learn Web programming has a great deal of difficulty, so I recommend O'Reilly's "Java Server ages" this book to learn Web programming. EJB enterprise application books: "Enterprise JavaBeans, 2nd Edition" EJB learning threshold is relatively high, it is difficult to get started, but this book completely reduces the difficulty of learning, especially important point is that the study of EJB needs to be combined with a specific implementation of the App Server, so in the study of EJB at the same time, must be synchronized to learn some kind of App Server, and this book. Learning some kind of App Server, and this book is related to the three books, respectively, Weblogic6.1, Websphere4.0 and JBoss3.0 above the deployment of the book examples of practical work. Really both theory and practice. In the learning of EJB at the same time, you can do while watching, EJB learning will become very easy. Ed Roman's "Mastering EJB 2.0" This book is based entirely on the EJB2.0 specification , written in depth , covering all aspects of EJB programming , and there are many programming experience tips , but also to learn the EJB is very much one of the recommended books

Combined with Weblogic to learn J2EE :

The J2EE applications and BEA Weblogic Server" is definitely the first choice of reading this book is the official BEA recommended textbook this book combined with Weblogic introduces all aspects of J2EE technology in the development and deployment of Weblogic platform, practical guidance is very strong. Design Patterns: Sun's "J2EE Core Patterns" This book is the development of each Java enterprise platform software architects must have the book This book introduces a comprehensive J2EE architecture of the various design patterns, is a must-read books for designers. Personal recommendation: please Hua University Press practical "J2EE Application Architecture"

3. Java Learning Path (three), the process

The first step is to install the JDK, write a Hello World, in fact, JDK learning is not so simple, about the JDK there are two problems is easy to have been troubled Java programmer's place: one is the CLASSPATH problem, in fact, in principle, is to figure out the JRE ClassLoader is how to load Class; another problem is the package and import issues, how to find the path of the class problem. These two issues to figure out the biggest obstacle to learning Java and using the JDK.

The second step is to learn the syntax of Java, which is C++-like. Basically, the mainstream programming languages are either C-like or C++-like, and there's nothing new, so learning the syntax is about half a day's worth of work. The only thing I need to pay attention to is the usage of a few keywords that aren't easy to figure out, public, protected, private, static, when to use them, why to use them, how to use them, this may need someone to point them out, I was completely on my own at the beginning to figure it out, it took me a long time. But then I saw that the Thinking in Java book above was talking about these concepts.

The third step is where you learn the features of Java's object-oriented programming language. Such as inheritance, constructors, abstract classes, interfaces, polymorphism of methods, overloading, overriding, Java's exception handling mechanism.

The fourth step is to start familiarizing yourself with Java's class libraries. Java's basic class library is actually the JDK installation directory below the jre\lib\rt.jar package. Learning the basic library is to learn rt.jar. The real core for us only four, respectively: java.lang.*; java.io.*; java.util.*; java.sql.*; First of all, we have to read through the entire package of the framework, understand the entire package of class, interface, exception composition. exceptions. Then to understand, each package of Java provides us with which classes, each class is used in what occasions, when I encounter problems, I know which class, or which combination of classes can solve my problems. Coding, specific method calls, is to write code, while checking the Documentation.

The fifth step, through the above study, if you learn a more solid, if you have played a good foundation of Java, the rest of the work to be done is to clear the Documentation in addition to the above four packages in addition to some of the other more useful classes. I believe that progress to this point, Java's self-learning ability has been developed, you can get to the level of learning Documentation directly.

Sixth step, Java Web Programming :Web programming is the core of the HTTP protocol, HTTP protocol and Java has nothing to do with the study of the HTTP protocol is essential. If you are familiar with the HTTP protocol, then there is a good foundation for Java programming, learning Servlet/JSP is easy. Through a period of effort you can start using JSP to do the project. In addition, Java Web programming learning to focus on WebApplication design patterns, how to analyze the business logic, and reasonable design, in accordance with the requirements of the MVC design pattern, the use of Servlet and JSP to complete the different logic layers, master how to control the process between Servlet and JSP and data ** ** enjoyment, and how Web Application should be * enjoy, and how the Web Application should be configured and deployed.

Seventh step, J2EE programming The above learning process if it is relatively smooth, to this step, the difficulty is steeply increased. Because the above knowledge content are only involved in one aspect, and like EJB, JMS, JTA and other core J2EE specification is often the crystallization of the integrated use of several Java technologies, so it is more difficult to master. J2EE specification includes JNDI, RMI, EJB, JMS, JTA, Servlet/JSP, JDBC and other core technologies, each of which requires you to study hard. After this you will realize that you have to learn two areas of knowledge, one is UML, the other is Design attern. Java enterprise software design attaches great importance to the design of the framework (Framework), a good software framework is a necessary condition for the success of software development. At this time, should begin to focus on learning on design patterns and frameworks, through learning and practical programming experience to master the EJB design patterns and J2EE core patterns.

4. Java Learning Path (four), method

Java as a programming language, the best way to learn is to write code. When you learn a class, you can write a simple example program to run to see what the results, and then call a few more methods of the class to see the results, so very intuitive to the class to learn, and remember very deep. Then should not be satisfied with the code through, you should think about if I do not write this way, a different way, and then try to work. Remember which high people said that learning to program is a process of destruction, the examples in the book, their own learning Documentation written examples in the run-through, and then constantly try to use different methods to achieve, and constantly try to destroy the code structure, to see what results it will have. By doing so, you will be very thorough and very proficient in Java.

Finally, I hope you enjoy your studies!