編譯和運行

1.

帶包路徑的編譯:

[bmclaugh:~/Documents/developerworks/castor] javac -d . *.java


有包路徑的運行:

[bmclaugh:~/Documents/developerworks/castor] java com.yinbodotcc..MarshalTester

 

 

 

2.相對路徑問題

import org.exolab.castor.xml.Marshaller;

class...

{

...

FileWriter writer = new FileWriter("person.xml");

......

}

注意這裏的person.xml是相對包的, 即和org目錄同一個層次

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章