*.java的檔案如何在Xcode下編譯?

Mac 軟體使用經驗交流專區

版主: Alex Tsaiross_ttdigdog

回覆文章
內容
發表人
iRalf
新生訓練中
文章: 6
註冊時間: 09/05/2004 3:21 pm

*.java的檔案如何在Xcode下編譯?

#1 文章 iRalf »

:roll:現在學校在教JAVA,今天我在我的pc上寫了一個範例練習,在pc上編譯跟執行都沒有問題,但是我用隨身碟將檔案複製到ibook上用Xcode1.1開卻無法編譯,請問有在使用Xcode的前輩們能否教我一下如何用Xcode編譯,我知道在pc上要設定path路徑,那麼在mac上是不是也要設定呢?如果要的話該怎麼設定阿?

另外我聽說Xcode2.0是gui界面,請問這程式有被分享嗎 :?:
頭像
janusng
嗜冰客
文章: 1048
註冊時間: 04/30/2001 1:01 am
來自: Metropolis Asylum
聯繫:

#2 文章 janusng »

你有選對 Project type 嗎?

還有,Xcode 現在是 1.5 版了,先 update 了 Developer Tools 再試吧。 :wink:
圖檔
It is not god who created man. It is man who created God.

Light travels faster than sound. This is why some people appear bright until you hear them speak.
iRalf
新生訓練中
文章: 6
註冊時間: 09/05/2004 3:21 pm

#3 文章 iRalf »

我沒有選用project type餒,我是直接把在pc上寫的java擋直接copy到mac上,然後點選兩下自動以Xcode開啟,但是卻不能編譯
頭像
janusng
嗜冰客
文章: 1048
註冊時間: 04/30/2001 1:01 am
來自: Metropolis Asylum
聯繫:

#4 文章 janusng »

你先在 Xcode 上的 File Menu->New Project...

選 Java Tool,再將你的 file 加入新 Project 中,取代 原本唯一的 java file,或是將 code 抄入那 file 中,再 compile 便行了。

雖然機會不大,但也提一提你,如果有 GUI,你可能要選 Java Swing Applet/ Application 或 Java AWT Applet/ Application。
圖檔
It is not god who created man. It is man who created God.

Light travels faster than sound. This is why some people appear bright until you hear them speak.
iRalf
新生訓練中
文章: 6
註冊時間: 09/05/2004 3:21 pm

#5 文章 iRalf »

恩 感謝泥 我選用 JAVA TOOL 然後將舊的檔案原始碼取代確實可以,我之前選用Java Swing Applet/ Application 卻不行, 這兩個有什麼差別嗎? 還有Xcode為啥會自己建立好多檔案?如果我今天不開專案而是直接開啟新的檔案好像也無法編譯餒?
回覆文章