編譯Java對於windows我只是用一個批處理腳本來編譯我的程序:問題在CentOS 5.6
@echo off
title Building...
echo Building Server - please wait...
echo ---------------------------------------
set javac="C:\Program Files\java\jdk1.6.0_24\bin\javac.exe"
set libs=bin;
set dirs=src\server\*.java
set dirs=%dirs% src\server\commands\*.java
set dirs=%dirs% src\server\components\*.java
set dirs=%dirs% src\server\item\*.java
set dirs=%dirs% src\server\net\*.java
set dirs=%dirs% src\server\randomevent\*.java
set dirs=%dirs% src\server\minigames\*.java
set dirs=%dirs% src\server\minigames\trawler\*.java
set dirs=%dirs% src\server\minigames\trawler\game\*.java
set dirs=%dirs% src\server\quests\*.java
set dirs=%dirs% src\server\skills\runecrafting\*.java
set dirs=%dirs% src\server\skills\slayer\*.java
set dirs=%dirs% src\server\tasks\*.java
set dirs=%dirs% src\server\tasks\net\*.java
set dirs=%dirs% src\server\threading\*.java
%javac% -classpath %libs% %dirs% -d bin
echo ---------------------------------------
title Buld complete.
echo Build complete.
pause
一切編譯罰款。 所以我在我的項目移動到我的CentOS的VPS,並嘗試使用bash腳本
echo Building...
echo Building Server - please wait...
echo ---------------------------------------
libs=bin
dirs=src/server/*.java
dirs=$dirs src/server/commands/*.java
dirs=$dirs src/server/components/*.java
dirs=$dirs src/server/item/*.java
dirs=$dirs src/server/net/*.java
dirs=$dirs src/server/randomevent/*.java
dirs=$dirs src/server/minigames/*.java
dirs=$dirs src/server/minigames/trawler/*.java
dirs=$dirs src/server/minigames/trawler/game/*.java
dirs=$dirs src/server/quests/*.java
dirs=$dirs src/server/skills/runecrafting/*.java
dirs=$dirs src/server/skills/slayer/*.java
dirs=$dirs src/server/tasks/*.java
dirs=$dirs src/server/tasks/net/*.java
dirs=$dirs src/server/threading/*.java
javac -classpath $libs $dirs -d bin
echo ---------------------------------------
title Buld complete.
echo Build complete.
編譯和我一定是做錯了什麼。我得到這些錯誤:
有人可以幫我弄清楚我做錯了什麼嗎?有語法錯誤嗎?
我強烈建議你試用Apache Ant。這是爲了這樣的事情。 – vbence 2011-05-23 21:09:46