我在Unix中的Java代碼版本是1.5,但是我已經使用eclipse在1.5版本中開發了該jar。不能通過更改Java來編譯Unix中的Jar版本號
我嘗試從unix執行以下命令,但失敗。
javac -source 1.7 -target 1.5 -bootclasspath xml_test.jar
參見:How to run .jar file on unix?
登錄:
-bash-3.00$ javac -source 1.5 -target 1.5 -bootclasspath xmltest.jar javac: no source files Usage: javac <options> <source files> where possible options include: -g Generate all debugging info -g:none Generate no debugging info -g:{lines,vars,source} Generate only some debugging info -nowarn Generate no warnings -verbose Output messages about what the compiler is doing -deprecation Output source locations where deprecated APIs are used -classpath <path> Specify where to find user class files -cp <path> Specify where to find user class files -sourcepath <path> Specify where to find input source files -bootclasspath <path> Override location of bootstrap class files -extdirs <dirs> Override location of installed extensions -endorseddirs <dirs> Override location of endorsed standards path -d <directory> Specify where to place generated class files -encoding <encoding> Specify character encoding used by source files -source <release> Provide source compatibility with specified release -target <release> Generate class files for specific VM version -version Version information -help Print a synopsis of standard options -X Print a synopsis of nonstandard options -J<flag> Pass <flag> directly to the runtime system
能否請您提出任何想法?
請參閱此問題http://stackoverflow.com/questions/ 1333708/how-to-jar-file-on-unix – logan
這並不改變事實。你仍然無法編譯一個罐子。正如在該問題中接受的答案中所解釋的那樣,您需要重新編譯源代碼,支持較舊的目標,或升級您的unix JVM。 –
在哪裏重新編譯?在Unix或eclipse中? – logan