跳到主要內容

Eclipse with Google App Engine不能編譯JSP

在eclipse來開發Google App程式是最方便也不過的事了,只是不才小弟剛開始使用eclipse作為IDE介面,實在有許多地方不知其所以然,至今遇到兩個麻煩的問題。

Q1:利用Google App Engine Plug-in建立的Web Application Project竟然在新增JSP檔的時候無法編譯為Servlet (註:JSP在第一次執行時IDE會編譯成Servlet,web server實際執行的是此Servlet程式,所以初次開啟JSP會比較慢),在JSP檔案前會出現一個小叉叉,編譯時出現Your Web Application Project must be configured to use a JDK in order to use JSPs.的錯誤訊息。
Google針對這個問題有特別解釋。

My JSPs aren't working, and there's an error that says "Your Web Application Project must be configured to use a JDK in order to use JSPs." What happened?

Both the local App Engine server and the deployment process need to run javac in order to compile your JSPs. If your project isn't set to use a JDK ("Java Development Kit", which includes javac), then the JSPs can't be compiled.

Go to Preferences > Java > Installed JREs and make sure that you have a JDK installed -- if you don't, you can easily download one. Now right-click on your project and choose Properties > Java Build Path > Libraries and make sure that your project is using this JDK.

引用自:http://code.google.com/intl/zh-TW/eclipse/docs/faq.html#jspneedsjdk


原來 Eclipse 中的 JRE 路徑設在 JRE 版本,而非 JDK 版本中,於是導致此一錯誤。

Preferences > Java > Installed JREs 中改設定為 JDK 版本後就正常了。

有圖有真相。







Q2:利用Google App Engine Plug-in建立的Web Application Project竟然無法新增Servlet。



此問題目前還無解,爬了一些文,問題好像是Google App Engine Plug-in的一個Bug,我目前是開兩個專案,在Dynamic Web Project中Create Servlet完成後再手動加到Web Application Project中。

留言

這個網誌中的熱門文章

系統時間自動校正

在網域內通常為了安全性會防堵所有對外不必要的端口,因此常會在網域內架設一Time Server做為各伺服器時間校對的標準,而此一Time Server需透過UDP 123端口與中央標準局time.stdtime.gov.tw做時間校對,再網域內的其他伺服器則與此Time Server做時間校對。 開啟防火牆NTP端口(UDP 123) 編輯系統登錄檔 [執行] -> regedit 修改NTP Server為中央標準局主機 time.stdtime.gov.tw 並將Type預設值NT5DS改為NTP [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W32Time\Parameters] "NtpServer"="ComputerName" "Type"="NTP" 修改校對頻率為a (每10分鐘校對一次,5為每5分鐘校對一次) [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W32Time\Config] "AnnounceFlags"=dword:0000000a 重啟Windows Time Service net stop w32time && net start w32time 強制立即校對 w32tm /resync /rediscover 補充一: 強制時間同步指令 w32tm /resync /computer:IP /rediscover net time \IP /set /yes net time \\ComputerName /set /yes 若您的主機一直無法同步,也可以採用變通的方法,配合上面的Dos command以工作排程來進行。 補充二: A. 將伺服器類型變更為 NTP。如果要執行這項操作,請依照下列步驟執行: 1. 按一下 [開始],再按一下 [執行],輸入 regedit,然後按一下 [確定]。 2. 找出並按一下下列登錄子機碼: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W32Time\Parameters\Ty...

利用保存屬性來做實體檔案的差異性備份

先來談談iwndows裡檔案的保存屬性 利用滑鼠右鍵點選[內容]查看檔案的屬性時,在屬性可以看到[唯讀][隱藏]之外還可以點選[進階]按鈕, 其中「檔案已經可以開始封存」就是以前看到的「保存」屬性。 如果在DOS環境下指令attrib,檔名的前面出現「A」就是有「保存」屬性。 而「保存」屬性出現的時機是: 1. 檔案新建立 2. 檔案被變更過內容 因此系統給予此檔案A屬性,就等於告訴備份指令XCOPY或備份軟體,這個檔案需要被備份。 所以,我們可以透過這個屬性來進行檔案的增量式(Incremental)備份與差異式(Differential)備份。 將Files底下所有有異動過的檔案,複製到diff資料夾底下,並且取消此檔案的A屬性。 xcopy "C:\Files\*.*" c:\diff /s/d/y/M 如果我們在這個異動之後將diff資料夾內的所有東西都搬走,我們做的就是差異性備份,如果不搬走讓他一直累積就是增量式備份。 XCOPY 指令 XCOPY source [destination] [/A | /M] [/D[:date]] [/P] [/S [/E]] [/V] [/W] [/C] [/I] [/Q] [/F] [/L] [/G] [/H] [/R] [/T] [/U] [/K] [/N] [/O] [/X] [/Y] [/-Y] [/Z]\r\r [/EXCLUDE:file1[+file2][+file3]...] source 指定要複製的檔案。 destination 指定位置或者/以及新檔案的名稱。 /A 只複製設定成保存屬性的檔案,不要改變屬性的設定。 /M 只複製設定成保存屬性的檔案,並清除保存屬性。 /D:m-d-y 複製在指定日期當天或之後發生變更的檔案。如果沒有給日期, 只複製那些來源檔案日期比目的檔案日期為新的檔案。 /EXCLUDE:file1[+file2][+file3]... 指定檔案清單字串。每個...

C# 開啟Raw檔案

朋友問raw格式的影像該怎麼用程式show出來看? 因為是影像處理的入門問題,所以當然不能先透過影像處理軟體處理好再丟到程式裡面show出來,剛剛完成,就把重點節錄下來。 重點是Bitmap的圖示矩陣式的,而Raw是線性的的正矩形圖片,長、寬要自己利用開更號方式計算,再一個像素一個像素塞回去。 private void button1_Click(object sender, System.EventArgs e) { int rawSize; Bitmap bm; openFileDialog1.Filter = "RAW files (*.raw)|*.raw|BMP files (*.bmp)|*.bmp|JPEG files (*.jpg)|*.jpg|TIFF files (*.tif)|*.tif"; if (openFileDialog1.ShowDialog()==DialogResult.OK) { if (openFileDialog1.FileName.Substring(openFileDialog1.FileName.Length-3,3) =="raw") { FileStream infile = File.Open(openFileDialog1.FileName, FileMode.Open,FileAccess.Read, FileShare.Read); this.textBox1.Text = openFileDialog1.FileName; rawSize = (int)Math.Sqrt(infile.Length); bm = new Bitmap(rawSize,rawSize); BinaryReader tmpBReader = new BinaryReader(infile); byte buff; for (int i=0; i < rawSize; i++ ) { for (int j=0; j < rawSize; j++ ) { buff = tmpBReader.ReadB...