我正在使用Maven构建并获得看似无害的“未找到符号”错误 - 问题是我已经验证使用我所知道的所有低级Java工具构建是正确的并且它看起来不透气。我用这个命令行构建了:
javac -d /home/dan/EmailClient/Initial-Client/target/classes -classpath <many jars>:
/thepath/Common/1.0-SNAPSHOT/Common-1.0-SNAPSHOT.jar /* I need this one */
-sourcepath /thepath/src/main/java: <the files>
-s /thepath/target/generated-sources/annotations
-g -nowarn -target 1.7 -source 1.7 -encoding UTF-8
收到此错误:
Launcher.java:119: error: cannot find symbol
return Promise.onPool(getterPool).continueWith(new Transformer<Void, Promise<List<Void>>>() {
(错误指向onPool
)
并且通过在命令行中复制并粘贴目录来运行jar xf Common-1.0-SNAPSHOT.jar
(cd
),然后
javap Promise.class
显示
public static me.unroll.functional.Promise<java.lang.Void> onPool(java.util.concurrent.Executor);
所以这看起来不透气 - 我错过了什么调试步骤?
此外,这在单独的机器上构建良好,并且在Eclipse中运行良好,所有相关的源文件都打开了,而不是来自我的实际构建机器。
答案 0 :(得分:2)
我建议您检查类路径中的<many jars>
部分,您可能会在那里找到Maven制作的jar的旧版本,它正在赢得类名解析游戏。