Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

javac: invalid flag: activation-1.1.jar

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.

like image 796
user3114967 Avatar asked Jan 13 '15 05:01

user3114967


1 Answers

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)

like image 132
Thilo Avatar answered Oct 20 '22 10:10

Thilo