我试图编译一个从命令行使用CPlex的java项目。我目前正在尝试的命令是
javac -cp "opt/ibm/ILOG/CPLEX_Studio_Community128/cplex/lib/cplex.jar" *.java
我得到了大约98个错误,我相信这些错误都源于第一个错误:
error: package ilog.concert does not exist
我相信它无法找到我想要包含的CPlex套餐。我完全确定" / opt"我上面使用的目录是安装CPlex的地方。请让我知道我应该尝试什么!
编辑:根据vim,这是我的cplex.jar文件中的主要内容:
zip.vim version v27
" Browsing zipfile /opt/ibm/ILOG/CPLEX_Studio_Community128/cplex/lib/cplex.jar
" Select a file with cursor and press ENTER
META-INF/
META-INF/MANIFEST.MF
ilog/concert/IloAddable.class
ilog/concert/IloAnd.class
ilog/concert/IloColumnArray.class
ilog/concert/IloColumnArray$Link.class
ilog/concert/IloColumnArray$SizeMismatchException.class
ilog/concert/IloColumn.class
ilog/concert/IloColumn$Link.class
ilog/concert/IloConstraint.class
ilog/concert/IloConversion.class
ilog/concert/IloCopyable.class
ilog/concert/IloCopyManager$Check.class
ilog/concert/IloCopyManager.class
ilog/concert/IloCopyManager$ExistFreeTerm.class
ilog/concert/IloCopyManager$ExistGroundTerm.class
ilog/concert/IloException.class
ilog/concert/IloIntCollectionVar.class
ilog/concert/IloIntExpr.class
ilog/concert/IloIntSet.class
ilog/concert/IloIntSetVar.class
ilog/concert/IloIntToIntFunction.class
ilog/concert/IloIntToNumFunction.class
...
答案 0 :(得分:0)
我需要的命令是
javac -classpath .:/opt/ibm/ILOG/CPLEX_Studio_Community128/cplex/lib/cplex.jar *.java
有关详细信息,请参阅javac文档:http://www.cs.yorku.ca/tech/other/java/docs/tooldocs/solaris/javac.html(我之前应该检查过这个问题:O)。
路径开头的.:
允许我包含我当前的目录。