1.å¦ä½ç¨eclipseåwebå¼å
2.javawebç¨ä»ä¹ç¼è¯å¨(javawebç¨ä»ä¹è½¯ä»¶ç¼å)
å¦ä½ç¨eclipseåwebå¼å
1.å¼åç¯å¢çæ建1.1.å¼åå·¥å ·
JDKï¼jdk1.6.0_
Web Serverï¼apache-tomcat-6.0.
IDEï¼eclipse-jee
1.2.æ建å¼åç¯å¢
ç±äºéæ©IDEä½ä¸ºå¼åçå·¥å ·ï¼IDEå¯ä»¥æå¨é ç½®éè¦çæä»¶å·¥å ·ï¼æ以æ建å¼åç¯å¢åå¾ç®åèåå¿«æ·ã
(1)å®è£ JDK
æ示ï¼å®è£ å®JDKä¹åéè¦é ç½®ç¯å¢åéã
(2)å®è£ tomcat
æ示ï¼å¦ææ¯è§£å缩çç´æ¥è§£åå°±okï¼å¦ææ¯å®è£ çéè¦æ ¹æ®å®è£ æ示å®æå®è£ ãå 为æ¯ä½¿ç¨IDEåå¼åï¼æ以就ä¸éè¦é ç½®tomcatçç¯å¢åéäºï¼ä¸è¿è¿æ¯å»ºè®®ä¸è¦å¤ªä¾èµäºIDEäºã
(3)解å缩Eclipse
æ示ï¼å¦æ没æå®è£ JDKå°±æ æ³å®æEclipseçå®è£ ã
好äºï¼å°è¿éå¼åç¯å¢å°±åå¤å¥½äºï¼æ¥ä¸æ¥ç¨ä¸ä¸ªdemoæ¥æ¼ç¤ºä¸ä¸å¦ä½å¨Eclipseä¸å¼åWeb项ç®ã
2.å¼åWeb项ç®
2.1.æ°å»ºWeb项ç®
Eclipse-->File-->New-->Dynamic Web Project,å¦å¾1ï¼
å¾1
å¦æ没ææè Eclipse-->File-->New-------->Web-->OtherDynamic Web Project,å¦å¾2ã3ï¼
å¾2
å¾3
éæ©Target runtimeä¸çNew Runtimeé ç½®Web Server
Next>
éè¿Browseéæ©tomcatçå®è£ ç®å½
Finish>
ä¹åï¼ä¸è·¯Nextç´å°Finishå°±oKäº
æ°å»ºçWeb项ç®ç»æå¦ä¸
2.2.å¼åServlet
å¨Project Explorerè§å¾çsrcä¸å³é®å¯ä»¥éæ©Newââ>Servlet
Next>â¦â¦
éæ©éåserviceæ¹æ³ï¼è¿æ ·å¯ä»¥èªå¨çæ代ç æ¹ä¾¿ä¸ç¹
å½ç¶ä¹å¯ä»¥å ¨æå¨çç¼åServletï¼ä¸è¿ä¸è¦å¿è®°å¨web.xmlä¸é ç½®Servletï¼åµåµ^_^
ç¶åFinishå°±å®æäºServletçå建
HelloServlet.javaçæºä»£ç å¦ä¸
[java] view plain copy
<span style="font-family:Microsoft YaHei;font-size:px;">package com.lanyoung.servlet;
import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.beanãä½æ¯ä¹å¯ä»¥ä½¿ç¨è¿äºï¼ä¸å»ºè®®çåå ä¸ä¾¿äºä½ äºè§£JavaAPIï¼åç¸å ³çç¼è¯åçï¼ç¼è¯è¿ç¨ä¹ç±»çã
javaç¯å¢æ³è¦ä»äºJavaå¼åï¼é£ä¹Javaè¿è¡ç¯å¢è¯å®æ¯ä½ é¦å éè¦å®è£ ç软件ï¼åå¦ä»¬å¯ä»¥èªè¡å»ç¾åº¦ä¸æç´¢Javaè¿å ¥å°å®ç½ä¸è½½å³å¯ï¼Javaç¯å¢çå®è£ åé ç½®æç¨ä¹åæè¿ä»ç»ï¼åå¦ä»¬ç¹å»ç¸å ³é 读å³å¯ã
Eclipse-IBMç©åºæ¥ç»å¼æºç¤¾åºçIDEï¼å ¶æ¬èº«å°±æ¯ä½¿ç¨Javaå¼åçã\x0d\MyEclipse-æEclipseå è£ äºä¸ä¸ï¼å äºJ2EEä¼ä¸å¼åç许å¤åè½å¼ºå¤§çæ件ã
netbeans.è¿ä¸ªè½¯ä»¶æç¨äºå¥½å¤å¹´äºï¼æºå¥½ç¨çï¼ç±å ¶å¨EJBå¼åæ¶ã
JAVAç¼ç¨å¸¸ç¨ç软件ï¼Eclipseï¼Eclipseæ¯ä¸ä¸ªå¼æ¾æºä»£ç çãåºäºJavaçå¯æ©å±å¼åå¹³å°ãå°±å ¶æ¬èº«èè¨ï¼å®åªæ¯ä¸ä¸ªæ¡æ¶åä¸ç»æå¡ï¼ç¨äºéè¿æ件ç»ä»¶æ建å¼åç¯å¢ã
javaç¨åºæ¯ç¨ä»ä¹è½¯ä»¶ç¼åçå?1ãJAVAç¼ç¨å¸¸ç¨ç软件ï¼IntellijIDEAIntellijIDEAæ¯å½åJavaå¼å人åå¼å£°å¾é«çä¸æ¬¾IDEï¼å ·æç¾è§ï¼é«æçä¼å¤ç¹ç¹ï¼å°ç¼è¿æ¯é常å欢çï¼æ以以å¾æé½æ¯å¨èªå·±çµèå®è£ è¿æ¬¾è½¯ä»¶çã
2ãæ°æ§ç¼ç¨ç°å¨ç¨çå¤çè¿æ¯MastercamãUGãCimtronãPowerMILLç软件ãå½å ä¹æCaxaï¼åèªç å¶ï¼ãNPUï¼è¥¿åå·¥ä¸å¤§å¦ç å¶ï¼çåè½ä¹å¾å¼ºå¤§ï¼éå大åä¸ç¨å·¥ä»¶çå å·¥ç¼ç¨ã
3ãç®ç§°IDEAï¼åæ ·æ¯ä¸æ¬¾å¾å¸¸ç¨çjava软件ãè½ç¶æ¯ä»è´¹è½¯ä»¶ï¼ä¸è¿javaçè¯è¨æ¯å è´¹çï¼ä¸è±é±å°±å¯ä»¥ä½¿ç¨ãå®çç¹ç¹å¨äºç¾è§ãé«æï¼å·ç§°æ¯âææºæ §çJavaideâï¼è½æä¾å¾å¼ºçåé æ§ã
4ãIntelliJIDEAç°å¨å¤§é¨åjavaå¼åè åºè¯¥é½ç¨çæ¯è¿ä¸ªãIntelliJIDEAæ两个çæ¬ï¼ä¸ä¸ªæ¯å è´¹ç社åºçï¼å¦å¤ä¸ä¸ªæ¯ä»è´¹çãä»è´¹çæ¥æçåè½æ´å¤ãç±JetBrainså¼åã
5ãIDEAæ¯Javaè¯è¨å¼åçéæç¯å¢ï¼IDEAå¨ä¸çè¢«å ¬è®¤ä¸ºæ好çJavaå¼åå·¥å ·ä¹ä¸ï¼ä½æ¯æ¶è´¹ç软件ï¼å¯¹åºæ们è¿äºç©·å°åæ¥è¯´ï¼æ¯ä¸ªåæ¶æ¯ãæææ们æä¸å½éæ³ã
6ãç¨myeclipseæè eclipseï¼è®°äºæ¬é½å¯ä»¥ãåå¦è çè¯ä¸å»ºè®®ä¸æ¥å°±ç¨IDEå¼åå·¥å ·æ¯å¦è¯´EclipseãMyEclipseãIntelliJIDEAãnetbeanãä½æ¯ä¹å¯ä»¥ä½¿ç¨è¿äºï¼ä¸å»ºè®®çåå ä¸ä¾¿äºä½ äºè§£JavaAPIï¼åç¸å ³çç¼è¯åçï¼ç¼è¯è¿ç¨ä¹ç±»çã
javaçç¼è¯å¨æ¯ä»ä¹æ¨èJcreatorï¼å®å¯¹äºåå¦è æ¯ä¸ªå¾å¥½çå¼åå·¥å ·ï¼åå°è¿è¡ä¹å¾å¿«ãå®è¦ç¨å°JDKï¼å¤§çIDEæJBuilderï¼netbeanï¼sunstdioï¼eclipseãç¼è¯å¨å°±æ¯å°ä¸ç§è¯è¨(é常为é«çº§è¯è¨)ç¿»è¯ä¸ºå¦ä¸ç§è¯è¨(é常为ä½çº§è¯è¨)çç¨åºã
JDKæä¾çç¼è¯å¨æ¯javacï¼å®æ¯Javaç¼è¯å¨çæ åå®ç°ãå®å¯ä»¥å°Javaæºä»£ç ç¼è¯æJavaåèç ï¼è¿äºåèç å¯ä»¥å¨Javaèææºï¼JVMï¼ä¸è¿è¡ãJavacæ¯ä¸ä¸ªå½ä»¤è¡å·¥å ·ï¼å¯ä»¥ä½¿ç¨å®æ¥ç¼è¯Javaæºä»£ç ã
javacæ¯Javaç¼è¯å¨ï¼è´è´£å°Javaæºä»£ç 转æ¢æåèç æ件ãjavacå¯ä»¥éå¼ç¼è¯ä¸äºæ²¡æå¨å½ä»¤è¡ä¸æåçæºæ件ãç¨-verboseé项å¯è·è¸ªèªå¨ç¼è¯ãå½ç¼è¯æºæ件æ¶ï¼ç¼è¯å¨å¸¸å¸¸éè¦å®è¿æ²¡æè¯å«åºçç±»åçæå ³ä¿¡æ¯ã
ä¸eclipse/myeclipseå½å¹´å¦ä¹ javaï¼æå æ¥è§¦å°çå°±æ¯eclipseãåäºä¸ªå»ï¼å½æ¶æè§eclipse好çåï¼æ好å¤å è¿çåè½ï¼å¯ä»¥æ¹ä¾¿å°è¿è¡å 管çã