javac:invalid flag:activation-1.1.jar [英] javac: invalid flag: activation-1.1.jar

查看:1142
本文介绍了javac:invalid flag:activation-1.1.jar的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Tomcat7,jdk 1.7.0_55& eclipse,当我尝试使用COMMAND PROMPT编译整个项目(Java代码)时,它显示错误,如
javac:无效标志:D:\ COMPILE \lib \ 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

运行Step.2命令后显示Error.so我从我的lib文件夹&中删除了错误jar文件。运行命令,但它与另一个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.

注意:我已经有ANT build.xml但我想通过COMMAND PROMPT编译项目。

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

推荐答案

lib * .jar 由命令shell扩展。你需要通过使用引号来避免这种情况。

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

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

-cp 的参数是单一路径list(如 $ PATH ,而不是多个参数,每个参数一个路径)。多个文件可以用分隔:(或Windows上的;

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)

这篇关于javac:invalid flag:activation-1.1.jar的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆