What is java? Why java? Everyone learns Java to have their own reasons, basically Java is a better object-oriented language, API rich is the current programming language, J2SE / J2ME / J2EE develops well in various development fields. Java Will not replace other development language or development platforms, such as C / C / C # or Delphi / .Net is not the best language, only some application occasion relatively suitable language JRE Java 2 Runtime Environment, Java runtime environment includes Java virtual Machine (JVM), and must be class a must-have environment that runs Java programs and web applets it is included in J2SDK, or downloaded (about 10m) download address: http://java.sun.com/ Getjava / Download.html JDK / SDK / J2SE Java 2 Software Development Kit, Standard EDTION is a must-have environment for developing Java, including tools such as compilers and a large number of libraries, and also comes with the download address in general IDE: http: // Java.sun.com/j2se/downloads.html J2EE Java 2 Platform, Enterprise Edition is the main technology of Java in enterprise applications, and is currently the most important applications of Java include JAXP, JAXR, JAX-RPC, Saaj, Jaas, JavaMail, JMS, JSF, JSP / Servlet, etc. Development J2EE, You can download the J2EESDK development package. General IDE also belongs to the link: http://java.sun.com/J2ee J4me Java 2 Platform, Macro Edition is the main technical related links for Java applications to embedded systems (such as mobile phones) : Http://java.sun.com/J2ME development method The IDE (integrated development environment) can greatly improve the development efficiency but if you begin a Java, we recommend JDK
EDITPLUS or UltraEdit is simple, but it can learn more premature dependence Ide will only let you give the Java API some water, knowing a semi-solving. Once you have failed to master the basic syntax of Java, after you have a solid foundation, then choose a The development of IDE is very easy to learn or use Java. It is very important to use Javadoc (recommended using javadochelper, similar MSDN interface) version, in fact, slightly book is not a problem, it is not a problem, set the environment variable, after installation of JDK To configure environment variables Windows 2000 My Computer -> Properties -> Advanced -> Environment Variable Add the following environment variable (assuming your Java installation in d: /java/j2sdk1.4.2) Variable name value Description Java_Home D: / java / J2SDK1.4.2 classpath. Represents the current directory, search the current directory PATH ...;% java_home% / bin ... indicates that the original path value is newly opened, type Java and Javac Test Linux below to Redhat, Bash For example, different distributions slightly different, the settings of environment variables are detailed in the UNIX / Linux version to modify .bash_profile, such as vi ~ / .bash_profile java_home = / usr / local / java / j2sdk1.4.2 ClassPath =. Path = $ path: $ java_home / bin export java_home classpath re-logs in, make this setting take effect, enter the Java Javac test in the terminal to test the simple test program code: ------------- ----------------- Public Class Test {public static void main (string [] args) {system.out.println ("Hello World!");}} --- ---------------------------------- Use Notepad and other tools to prepare it to Test.java pay attention, if you Windows Settings 'does not display known extensions', it is likely to be saved as Test.java.txt and then in the command line tool, CD to Test.java's directory,
Executive Javac Test.java Java Test About Java's Study Java, please see a system to explain the book in Java, there are many books in the market, the big difference, it doesn't matter to pick the book, but try to pick the language to explain the syntax of the high version. Don't choose "VJ Getting Started to Jing", the recommended books such as Java In a nuthell, Java University tutorial, Java core technology, Java programming ideas, etc., learn Java's basic knowledge, must practice, I have someone else to write some common API, don't over-reliance on the IDE code Tips Development Tool JBuilder's most mainstream IDE, is the big brother of Java development tools, the latest version of the latest version JBuilder 2005 No matter the development J2SE, J2ME, J2EE or XML / WebService is a tool for free download, but there are fewer features to circulate enterprise versions, in order to avoid unnecessary trouble, please use carefully (especially in the company) Related links: http://www.borland .com / products / jbuilder eclipse emerging Java IDE, free, open source, cross-platform, powerful, running speed, can be extended by developing new plugins to extend existing plugins, such as in existing Java development environments Add a Tomcat server plugin.
Related links: http://www.eclipse.org Ant It is a popular Java Build tool, "Everyone Should Use Ant" Ant is not an IDE, but you can do a lot of IDE, such as compilation / packaging / deployment / unit test / CVS, etc. For the medium-size project, it is necessary to rely on many class libraries and have complex package structures to use Ant processing. These are excellent selection related links: http://ant.apache.org JSP Java Server Page, a Java One technology of web development, and JavaScript have no relationship. Servlet is prior to the dynamic web technology that appears in JSP, similar to CGI, but uses multi-threaded processing. JSP / servlet and Java relationship servlet just inherited the Httpservlet's Java class, and JSP will eventually be compiled into servlets and perform a lot of problems encountered when developing Web, in fact, but there is no relationship with JSP / servlet itself, but ordinary Java issues. A qualified JSP / servlet programmer should first be qualified Java programmers.
It is recommended that before learning and use JSP / servlet, first, first, first, Java, the following issues are not part of the JSP / Servlet category. Commonly used API, such as "How to get the INT to String" "How to get Current Time" "How to Create Thread" .JDBC use and related precautions, such as "How I am inserted into data is garbled". Other J2EE technology use, such as "How to Use JavaMail" "How to Access EJB" Recommend Book If possible, please read a book The system's books guide you to learn this technical author only read "JSP Advanced Programming" (Machinery Industry 2001, Liao Ruo) Other large publishers published books should be good, such as Wrox, O'Reilly, or domestic publishing house It is best to choose JSP 1.2, servlet 2.3 specification or above Tomcat This is an open source JSP / servlet server, which is a reference implementation of JSP / servlet, suitable for beginners http://jakarta.apache.org/tomcat/ Tomcat 4.1 and Tomcat 5 are currently stable versions. The latter supports the latest JSP / Servlet standard recommendations to download zip version, unzipped, run BIN / STARUP.BAT, if the server started, if the startup failed, please make sure this machine The Java environment is correct. See Java_Home and Path Configuring the confedrity is the server configuration. WebApps is a directory written by the deployment website. Java Class should be put to how to assume that your index.jsp is X: / Test / Index. JSP, x: / test is your project directory TEST.CLAS The location of S should be x: /test/web-inf/classes/test.class project to 放 哪里 哪里 哪里 / / 如何 How to write a servlet package testservlet; import Java. io *;. import javax.servlet.ServletException; import javax.servlet.http *;. public class FooServlet extends HttpServlet {protected void doGet (HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {resp.getWriter () println ( ". Hi, I'm a servlet ");
}} This class javac -classpath servlet-api.jar fooservlet.java, this JAR can get compiled Class from Tomcat-5.0.19 / Common / LIB / servlet-api.jar to be compiled in x: / test / web- INF / CLASS / TESTSERVLET / FOOSERVLET.CLASS, where you have the name of TestServlet, you should try to write package to avoid inexplicably trouble compilation x: /test/web-inf/web.xml, modified to XML Version = "1.0" encoding = "UTF-8"?> Chinese p>, but cannot display the first line of JSP in JSP. <% @ Page ContentType = "Text / HTML; Charset = GB2312"%> 2. A Chinese is written in the form, such as can not be accepted < % System.out.println (Request.getParameter ("a"))));%> Solution Processing parameters before processing parameters in JSP or Servlet; 3. http: // Host / A. JSP? Name =