熱點推薦:
您现在的位置: 電腦知識網 >> 編程 >> Java編程 >> Java開源技術 >> 正文

搭建Eclipse+MyEclipse開發環境

2013-11-23 20:25:29  來源: Java開源技術 

  安裝JDK
 首先下載JDK Update(JDK Update的下載頁面為

 然後運行JDK 安裝程序jdk___windowsipexe安裝過程中所有選項保持默認
最後配置JDK的環境變量我的電腦上點右鍵—>屬性—>高級—> 環境變量(N)

  新建系統變量JAVA_HOMEC:\Program Files\Java\jdk_
 新建系統變量CLASSPATH;%JAVA_HOME%\lib;(注意點號表示當前目錄不能省略)
 在系統變量Path的值的前面加入以下內容%JAVA_HOME%\bin;(注意:這裡的分號不能省略)
 到這裡JDK安裝完畢

下面我們測試一下JDK是否安裝成功
將以下內容復制到記事本中

   public class HelloJAVA
{
public static void main(String srg[])
{
Systemoutprintln(Hello JAVA!);
}
}
 另存為HelloJAVAjava(不含引號下同)並保存到D盤根目錄下
 在命令行依次輸入下圖中紅線所標注的命令

  如果出現上圖紅框中所標注的內容則說明JDK安裝成功!

  注意:如果以後要安裝諸如EclipseBorland JBuilderJCreatorIntelliJ IDEA等集成開發環境(IDEIntegrated Development Environment)應該在IDE中編譯運行一個簡單的HelloWorld程序以保證IDE可以識別出JDK的位置

  安裝Tomcat
 首先下載jakartatomcatzip之所以下載免安裝版的好處是可以使用多個Tomcat(jakartatomcatzip的下載頁面為
/tomcat/tomcat/v/bin/>/v/bin/)
 然後將jakartatomcatzip直接解壓到D盤根目錄

  <fp src=http://imgeducitycn/img_///jpg onload=function anonymous()&#;&#;{&#;&#;function anonymous()&#;&#;{&#;&#;function onload(event) {&#;&#;&#;&#; function anonymous() {&#;&#;&#;&#; function anonymous() {&#;&#;&#;&#; function anonymous() {&#;&#;&#;&#; function anonymous() {&#;&#;&#;&#; function anonymous() {&#;&#;&#;&#; function anonymous() {&#;&#;&#;&#; function anonymous() {&#;&#;&#;&#; function anonymous() {&#;&#;&#;&#; function anonymous() {&#;&#;&#;&#; function anonymous() {&#;&#;&#;&#; function anonymous() {&#;&#; img_auto_size(this true);&#;&#; }&#;&#;&#;&#; }&#;&#;&#;&#; }&#;&#;&#;&#; }&#;&#;&#;&#; }&#;&#;&#;&#; }&#;&#;&#;&#; }&#;&#;&#;&#; }&#;&#;&#;&#; }&#;&#;&#;&#; }&#;&#;&#;&#; }&#;&#;&#;&#;}&#;&#;}&#;&#;} align=bottom twffan=done>

  最後配置Tomcat的環境變量我的電腦上點右鍵—>屬性—>高級—> 環境變量(N)
 新建系統變量CATALINA_HOMED:\jakartatomcat
 在系統變量CLASSPATH的值的後面加入%CATALINA_HOME%\common\lib;
 在系統變量Path的值中%JAVA_HOME%\bin;後面加入以下內容%CATALINA_HOME%\bin;

  到這裡Tomcat安裝完畢

  相關鏈接
Tomcat 安裝配置指南

  進行完一二兩步的設置以後各系統變量的值如下

  JAVA_HOME:C:\Program Files\Java\jdk_
CATALINA_HOME:D:\jakartatomcat
CLASSPATH:;%JAVA_HOME%\lib;%CATALINA_HOME%\common\lib;
Path:%JAVA_HOME%\bin;%CATALINA_HOME%\bin;%SystemRoot%\system;%SystemRoot%;%SystemRoot%\System\Wbem

  安裝Eclipse
 首先下載eclipseSDKwinzip(eclipseSDKwinzip下載地址為

 然後將eclipseSDKwinzip直接解壓到D盤根目錄
<fp src=http://imgeducitycn/img_///jpg onload=function anonymous()&#;&#;{&#;&#;function anonymous()&#;&#;{&#;&#;function onload(event) {&#;&#;&#;&#; function anonymous() {&#;&#;&#;&#; function anonymous() {&#;&#;&#;&#; function anonymous() {&#;&#;&#;&#; function anonymous() {&#;&#;&#;&#; function anonymous() {&#;&#;&#;&#; function anonymous() {&#;&#;&#;&#; function anonymous() {&#;&#;&#;&#; function anonymous() {&#;&#;&#;&#; function anonymous() {&#;&#;&#;&#; function anonymous() {&#;&#;&#;&#; function anonymous() {&#;&#; img_auto_size(this true);&#;&#; }&#;&#;&#;&#; }&#;&#;&#;&#; }&#;&#;&#;&#; }&#;&#;&#;&#; }&#;&#;&#;&#; }&#;&#;&#;&#; }&#;&#;&#;&#; }&#;&#;&#;&#; }&#;&#;&#;&#; }&#;&#;&#;&#; }&#;&#;&#;&#;}&#;&#;}&#;&#;} align=bottom twffan=done>

  到這裡 Eclipse安裝完畢

  安裝MyEclipse
 首先下載EnterpriseWorkbenchInstaller_GA_Eexe(EnterpriseWorkbenchInstaller_GA_Eexe 的下載地址為
l)
 然後安裝EnterpriseWorkbenchInstaller_GA_Eexe注意當安裝到下圖所示的步驟的時候要選擇Eclipse的安裝路徑(如圖)其他選項保持默認
<fp src=http://imgeducitycn/img_///jpg onload=function anonymous()&#;&#;{&#;&#;function anonymous()&#;&#;{&#;&#;function onload(event) {&#;&#;&#;&#; function anonymous() {&#;&#;&#;&#; function anonymous() {&#;&#;&#;&#; function anonymous() {&#;&#;&#;&#; function anonymous() {&#;&#;&#;&#; function anonymous() {&#;&#;&#;&#; function anonymous() {&#;&#;&#;&#; function anonymous() {&#;&#;&#;&#; function anonymous() {&#;&#;&#;&#; function anonymous() {&#;&#;&#;&#; function anonymous() {&#;&#;&#;&#; function anonymous() {&#;&#; img_auto_size(this true);&#;&#; }&#;&#;&#;&#; }&#;&#;&#;&#; }&#;&#;&#;&#; }&#;&#;&#;&#; }&#;&#;&#;&#; }&#;&#;&#;&#; }&#;&#;&#;&#; }&#;&#;&#;&#; }&#;&#;&#;&#; }&#;&#;&#;&#; }&#;&#;&#;&#;}&#;&#;}&#;&#;} align=bottom twffan=done>

  安裝完畢之後將MyEclipse安裝目錄下的features和plugins這個目錄覆蓋到Eclipse的安裝目錄下
 最後將剛才安裝的 MyEclipse 卸載
 解釋一下上面這樣做的原因 因為MyEclipse是Eclipse的插件所以只要把features和plugins這個目錄覆蓋到Eclipse的安裝目錄Eclipse就會自動認出這些插件
 到這裡MyEclipse安裝完畢

  破解MyEclipse
 運行MyEclipse注冊機MyEclipseKeyGenexe選擇MyEclipse的版本號輸入注冊名生成序列號(MyEclipsex注冊機的下載地址為
/rar)
 運行eclipseexe(首次運行要求指定Workspace)依次點擊Window > Preferences >MyEclipse>Subscription > Enter Subscription輸入注冊名以及注冊機生成的注冊碼
 到這裡MyEclipse破解完畢

  指定Eclipse+MyEclipse的JRE 和Tomcat 服務器
 設定Eclipse+MyEclipse的JRE
一般情況下Eclipse可以自動找到JRE我們不用進行過多的設置

 設定Eclipse+MyEclipse的Tomcat 服務器
只需設置圖中所標注的兩處即可圖中其余部分是自動生成的
<fp src=http://imgeducitycn/img_///jpg onload=function anonymous()&#;&#;{&#;&#;function anonymous()&#;&#;{&#;&#;function onload(event) {&#;&#;&#;&#; function anonymous() {&#;&#;&#;&#; function anonymous() {&#;&#;&#;&#; function anonymous() {&#;&#;&#;&#; function anonymous() {&#;&#;&#;&#; function anonymous() {&#;&#;&#;&#; function anonymous() {&#;&#;&#;&#; function anonymous() {&#;&#;&#;&#; function anonymous() {&#;&#;&#;&#; function anonymous() {&#;&#;&#;&#; function anonymous() {&#;&#;&#;&#; function anonymous() {&#;&#; img_auto_size(this true);&#;&#; }&#;&#;&#;&#; }&#;&#;&#;&#; }&#;&#;&#;&#; }&#;&#;&#;&#; }&#;&#;&#;&#; }&#;&#;&#;&#; }&#;&#;&#;&#; }&#;&#;&#;&#; }&#;&#;&#;&#; }&#;&#;&#;&#; }&#;&#;&#;&#;}&#;&#;}&#;&#;} align=bottom twffan=done>

  到這裡我們的Eclipse+MyEclipse開發環境就搭建完畢了!

  新建一個項目來測試一下Eclipse+MyEclipse開發環境是否搭建成功
 在Eclipse中依次點擊 File > New > Project 在彈出的New Project對話框中依次點擊Web Project >MyEclipse>JEE Projects>Web Project 再點NextProject Name中輸入項目的名字test最後點Finish

 在Eclipse左邊Package Explorer列表中點擊test將項目test展開右鍵點擊 WebRoot > New > JSP 新建一個名為hellojsp的 JSP 頁面 代碼如下圖(圖中標注部分需要我們手動添加其余部分是系統自動生成的)


  <fp src=http://imgeducitycn/img_///png onload=function anonymous()&#;&#;{&#;&#;function anonymous()&#;&#;{&#;&#;function onload(event) {&#;&#;&#;&#; function anonymous() {&#;&#;&#;&#; function anonymous() {&#;&#;&#;&#; function anonymous() {&#;&#;&#;&#; function anonymous() {&#;&#;&#;&#; function anonymous() {&#;&#;&#;&#; function anonymous() {&#;&#;&#;&#; function anonymous() {&#;&#;&#;&#; function anonymous() {&#;&#;&#;&#; function anonymous() {&#;&#;&#;&#; function anonymous() {&#;&#;&#;&#; function anonymous() {&#;&#; img_auto_size(this true);&#;&#; }&#;&#;&#;&#; }&#;&#;&#;&#; }&#;&#;&#;&#; }&#;&#;&#;&#; }&#;&#;&#;&#; }&#;&#;&#;&#; }&#;&#;&#;&#; }&#;&#;&#;&#; }&#;&#;&#;&#; }&#;&#;&#;&#; }&#;&#;&#;&#;}&#;&#;}&#;&#;} align=bottom twffan=done>

  再用同樣的方法 新建一個叫 hello_resultjsp 的JSP文件 代碼如下圖
<fp src=http://imgeducitycn/img_///png onload=function anonymous()&#;&#;{&#;&#;function anonymous()&#;&#;{&#;&#;function onload(event) {&#;&#;&#;&#; function anonymous() {&#;&#;&#;&#; function anonymous() {&#;&#;&#;&#; function anonymous() {&#;&#;&#;&#; function anonymous() {&#;&#;&#;&#; function anonymous() {&#;&#;&#;&#; function anonymous() {&#;&#;&#;&#; function anonymous() {&#;&#;&#;&#; function anonymous() {&#;&#;&#;&#; function anonymous() {&#;&#;&#;&#; function anonymous() {&#;&#;&#;&#; function anonymous() {&#;&#; img_auto_size(this true);&#;&#; }&#;&#;&#;&#; }&#;&#;&#;&#; }&#;&#;&#;&#; }&#;&#;&#;&#; }&#;&#;&#;&#; }&#;&#;&#;&#; }&#;&#;&#;&#; }&#;&#;&#;&#; }&#;&#;&#;&#; }&#;&#;&#;&#; }&#;&#;&#;&#;}&#;&#;}&#;&#;} align=bottom twffan=done>

   deploy(部署)項目
 點擊 deploy 按鈕(用紅線畫了的按鈕就是 deploy 按鈕) 在彈出的窗口中點擊Add 部署test項目(如圖所示)
<fp src=http://imgeducitycn/img_///jpg onload=function anonymous()&#;&#;{&#;&#;function anonymous()&#;&#;{&#;&#;function onload(event) {&#;&#;&#;&#; function anonymous() {&#;&#;&#;&#; function anonymous() {&#;&#;&#;&#; function anonymous() {&#;&#;&#;&#; function anonymous() {&#;&#;&#;&#; function anonymous() {&#;&#;&#;&#; function anonymous() {&#;&#;&#;&#; function anonymous() {&#;&#;&#;&#; function anonymous() {&#;&#;&#;&#; function anonymous() {&#;&#;&#;&#; function anonymous() {&#;&#;&#;&#; function anonymous() {&#;&#; img_auto_size(this true);&#;&#; }&#;&#;&#;&#; }&#;&#;&#;&#; }&#;&#;&#;&#; }&#;&#;&#;&#; }&#;&#;&#;&#; }&#;&#;&#;&#; }&#;&#;&#;&#; }&#;&#;&#;&#; }&#;&#;&#;&#; }&#;&#;&#;&#; }&#;&#;&#;&#;}&#;&#;}&#;&#;} align=bottom twffan=done>

   啟動Tomcat服務器
 如下圖所示(用紅線畫了的按鈕就是 啟動Tomcat 的按鈕)

  <fp src=http://imgeducitycn/img_///jpg onload=function anonymous()&#;&#;{&#;&#;function anonymous()&#;&#;{&#;&#;function onload(event) {&#;&#;&#;&#; function anonymous() {&#;&#;&#;&#; function anonymous() {&#;&#;&#;&#; function anonymous() {&#;&#;&#;&#; function anonymous() {&#;&#;&#;&#; function anonymous() {&#;&#;&#;&#; function anonymous() {&#;&#;&#;&#; function anonymous() {&#;&#;&#;&#; function anonymous() {&#;&#;&#;&#; function anonymous() {&#;&#;&#;&#; function anonymous() {&#;&#;&#;&#; function anonymous() {&#;&#; img_auto_size(this true);&#;&#; }&#;&#;&#;&#; }&#;&#;&#;&#; }&#;&#;&#;&#; }&#;&#;&#;&#; }&#;&#;&#;&#; }&#;&#;&#;&#; }&#;&#;&#;&#; }&#;&#;&#;&#; }&#;&#;&#;&#; }&#;&#;&#;&#; }&#;&#;&#;&#;}&#;&#;}&#;&#;} align=bottom twffan=done>

  Tomcat 啟動輸出信息如下圖
<fp src=http://imgeducitycn/img_///jpg onload=function anonymous()&#;&#;{&#;&#;function anonymous()&#;&#;{&#;&#;function onload(event) {&#;&#;&#;&#; function anonymous() {&#;&#;&#;&#; function anonymous() {&#;&#;&#;&#; function anonymous() {&#;&#;&#;&#; function anonymous() {&#;&#;&#;&#; function anonymous() {&#;&#;&#;&#; function anonymous() {&#;&#;&#;&#; function anonymous() {&#;&#;&#;&#; function anonymous() {&#;&#;&#;&#; function anonymous() {&#;&#;&#;&#; function anonymous() {&#;&#;&#;&#; function anonymous() {&#;&#; img_auto_size(this true);&#;&#; }&#;&#;&#;&#; }&#;&#;&#;&#; }&#;&#;&#;&#; }&#;&#;&#;&#; }&#;&#;&#;&#; }&#;&#;&#;&#; }&#;&#;&#;&#; }&#;&#;&#;&#; }&#;&#;&#;&#; }&#;&#;&#;&#; }&#;&#;&#;&#;}&#;&#;}&#;&#;} align=bottom twffan=done>

  項目test的運行結果
<fp src=http://imgeducitycn/img_///jpg onload=function anonymous()&#;&#;{&#;&#;function anonymous()&#;&#;{&#;&#;function onload(event) {&#;&#;&#;&#; function anonymous() {&#;&#;&#;&#; function anonymous() {&#;&#;&#;&#; function anonymous() {&#;&#;&#;&#; function anonymous() {&#;&#;&#;&#; function anonymous() {&#;&#;&#;&#; function anonymous() {&#;&#;&#;&#; function anonymous() {&#;&#;&#;&#; function anonymous() {&#;&#;&#;&#; function anonymous() {&#;&#;&#;&#; function anonymous() {&#;&#;&#;&#; function anonymous() {&#;&#; img_auto_size(this true);&#;&#; }&#;&#;&#;&#; }&#;&#;&#;&#; }&#;&#;&#;&#; }&#;&#;&#;&#; }&#;&#;&#;&#; }&#;&#;&#;&#; }&#;&#;&#;&#; }&#;&#;&#;&#; }&#;&#;&#;&#; }&#;&#;&#;&#; }&#;&#;&#;&#;}&#;&#;}&#;&#;} align=bottom twffan=done>

  我們可以去Eclipse的Workspace目錄下看看test項目的代碼也可以去Tomcat的webapps目錄下看看部署之後的 test項目的結構


From:http://tw.wingwit.com/Article/program/Java/ky/201311/28479.html
    推薦文章
    Copyright © 2005-2013 電腦知識網 Computer Knowledge   All rights reserved.