javac: invalid flag: activation-1.1.jar

11,327

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)

Share:
11,327
user3114967
Author by

user3114967

Updated on June 09, 2022

Comments

  • user3114967
    user3114967 almost 2 years

    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.