1. 程式人生 > >剛開始走向工作崗位初遇到的一些問題

剛開始走向工作崗位初遇到的一些問題

最近工作中用到jQuery外掛,需要安裝eclipse外掛才能支援jQuery智慧提示,在網上搜索了一下,常用的有三個外掛支援jQuery的智慧提示:
1.jQueryWTP
2.Spket
3.Aptana

在安裝外掛之前需要先安裝eclipse,如果已經安裝了eclipse,可以直接看下面的外掛安裝方法,本人使用的Fedora 12,操作如下:
1.直接開啟”應用程式”-->”系統工具”-->”終端”
2.輸入命令”su”,這個命令是臨時切換到root使用者
3.輸入root使用者的密碼
4.輸入命令”yum install eclipse”
5.安裝成功後,就可以在”應用程式”-->”程式設計”-->”eclipse”,開啟檢視版本為eclipse 3.5.1,當然也可以直接下載安裝,這裡就不再細說了,安裝完畢後就可以安裝相關外掛了.

以下分別介紹三個外掛的安裝方法:
一、jQueryWTP的安裝方法(官方):
step1:download jqueryWTP_version.jar
step2:find you Eclipse Plugin org.eclipse.wst.javascript.ui_xxxxxxx.jar,backup the plugin.
step3:double click the jar file or run with command java -jar jqueryWTP.version.jar
step4:on the opened swing UI,choose org.eclipse.wst.javascript.ui_xxxxxxx.jar,and output dir.
step5:click generate button.
step6:replace old org.eclipse.wst.javascript.ui_xxxxxxx.jar file with the generated file.
step7:restart eclipse.
step8:open a html file,edit js content.

jQueryWTP外掛專案的主頁:http://www.langtags.com/jquerywtp/
但是下載完jqueryWTP0.31foCN.jar後,根據安裝教程裡都提到了一個plugin目錄下的org.eclipse.wst.javascript.ui_xxxxxxx.jar檔案,但是我的eclipse目錄想壓根就找不到這個檔案,所以也要就不能使用jQueryWTP外掛智慧提示.

後來仔細檢視jQueryWTP外掛專案的主頁,有這麼一句話,Eclipse的WTP支援Javascript的程式碼補全功能,但是很簡單,而且不支援jQuery,jQueryWTP的目的就是讓Eclipse WTP支援jQuery,需要說明的是該外掛對於MyEclipse等基於Eclipse WTP的工具也是支援的.
根據這句話可以猜想找不到plugin目錄下的org.eclipse.wst.javascript.ui_xxxxxxx.jar檔案的原因,可能是沒有安裝eclipse WTP外掛,由於下面兩種方法順利安裝並且支援jQuery智慧提示,所以這裡的猜想還沒有經過驗證.

二、Spket的安裝方法(兩種方式):
1.線上安裝:Help->Install New Software...->Add...->Name: "Spket",
Location:http://www.spket.com/update/ 下載完畢重啟Eclipse.
2.手動安裝:到http://www.spket.com/download.html下載 Plugin 版本,當前版本為1.6.17.下載解壓後直接放置於Eclipse的dropins目錄下,重啟Eclipse.
3.下載jQuery檔案,(要下載開發版本).
4.設定spket ,Window -> Preferences -> Spket -> JavaScript Profiles -> New,輸入“jQuery”點選OK; 選擇“jQuery” 並點選“Add Library”然後在下拉條中選取“jQuery”; 選擇 “jQuery”並點選“Add File”,然後選中你下載的jQuery.js 檔案;設成Default;
5.設定js開啟方式(這一步很重要,不設定的話,也不會有jQuery的智慧提示), Window -> Preferences ->General-> Editors-> File Associations-> 選擇*.js,將Spket JavaScript Editor設為Default。
6.新建一個js檔案,jQuery自動提示!!

三、Aptana的安裝方法:
Aptana的安裝相對比較簡單,直接安裝完畢就支援jQuery的智慧提示,而且智慧提示功能也比較強大,按照下面的安裝就能使用,強烈建議初學者可以使用這種方法安裝:
1.線上安裝:Help->Install New Software...->Add...->Name: "Aptana",
Location:http://download.aptana.com/tools/studio/plugin/install/studio下載完畢重啟Eclipse,Aptana外掛安裝成功,支援javascript智慧提示功能,但還不支援jQuery智慧提示,需要再安裝支援jQuery智慧提示的外掛.
2.Window->My Studio開啟Aptana的首頁,單擊首頁上面的Plugins,選擇Ajax下面的jQuery Support,單擊Get It即可安裝jQuery智慧提示的外掛,如圖:

3.新建一個js檔案就會有jQuery智慧提示了.

另外,如果這三個外掛都安裝成功的話,想選擇其中一個外掛使用,應該如果操作呢?方法如下:
Window->Preferences->General->Editors->File Associations,選擇”*.js”,再選擇”Aptana JS Editor”或”Spket JavaScript Editor”設定為預設即可.

1 什麼是FindBugs FindBugs 是一個靜態分析工具,它檢查類或者 JAR 檔案,將位元組碼與一組缺陷模式進行對比以發現可能的問題。有了靜態分析工具,就可以在不實際執行程式的情況對軟體進行分析。不是通過分析類檔案的形式或結構來確定程式的意圖,而是通常使用 Visitor 模式來鑑別程式碼是否符合一些固定的規範。 2 如何安裝FindBugs? 作為Eclipse的一個外掛,可以將Findbugs整合到Eclipse中使用。 第二種方式是下載Findbugs外掛,將它放入Eclipse下的plusin資料夾,然後重啟Eclipse即可。 3如何使用FindBugs 安裝了Findbugs外掛後。右擊點選你要檢查的專案選擇【Find Bugs】->【Find Bugs】進行檢查。要檢視Findbugs檢查出了哪些Bug,可以選擇Windows選單->Show View->Bug Explorer,開啟Bug Explorer面板。如果想要檢視某個Bug詳細的資訊,則可以選擇Windows選單->Open Perspective,然後選擇FindBugs就可以開啟FindBugs的Properties面板,在這個面板裡面可以看到最詳盡的Bugs資訊。 To install the FindBugs plugin:
  1. In Eclipse, click on Help -> Software Update -> Find and Install...
  2. Choose the Search for new features to install option, and clickNext.
  3. Click New Remote Site.
  4. Enter the following:
    • Name: FindBugs update site
    • URL: one of the following (note: no final slash on the url)
      • http://findbugs.cs.umd.edu/eclipse for official releases
      • http://findbugs.cs.umd.edu/eclipse-candidate for candidate releases and official releases
      • http://findbugs.cs.umd.edu/eclipse-daily for all releases, including developmental ones
    and click OK.
  5. "FindBugs update site" should appear under Sites to include in search.
    Click the checkbox next to it to select it, and click Finish.
  6. You should see FindBugs Feature under Select features to install.
    (You may have to click on one or two triangles to make it visible in the tree.)
    Select the checkbox next to it and click next.
  7. Select the I accept option to accept the license and click Next.
  8. Make sure the location is correct where you're installing it. The default (your workspace) should be fine. ClickFinish.
  9. The plugin is not digitally signed. Go ahead and install it anyway.
  10. Click Yes to make Eclipse restart itself.

參見:http://yekui.iteye.com/blog/991272