javac: invalid flag: activation-1.1.jar

若如初见. 提交于 2019-12-22 08:23:35

问题


I'm using Tomcat7 , jdk 1.7.0_55 & eclipse, when I trying to compile the entire project(Java Code) using COMMAND PROMPT, its showing Error Like javac: invalid flag: D:\COMPILE\lib\activation-1.1.jar. The given below steps are followed to compile the code.

Step.1: dir *.java /s /b > FilesList.txt
Step.2: javac @FilesList.txt -d compiledCode -cp D:\COMPILE\lib\*.jar

After run the Step.2 command its showing Error.so I removed the error jar file from my lib folder & run the command but its showing same error with another jar.

Note: I Already have ANT build.xml but I want to compile the project through COMMAND PROMPT.


回答1:


The lib*.jar gets expanded by the command shell. You need to avoid that by using quotes.

***** -cp "D:\COMPILE\lib\*" ***** 

The argument to -cp is a single path list (like $PATH, not multiple arguments with one path each). Multiple files can be separated by : (or ; on Windows)



来源:https://stackoverflow.com/questions/27915204/javac-invalid-flag-activation-1-1-jar

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!