I had a problem compiling code that has maven dependency on jline-0.9.94. In particular, I am compiling Groovy 1.7.6 using my Ant target and getting the following error:
[...] -banner: [echo] Java Runtime Environment version: 1.6.0_22 [echo] Java Runtime Environment vendor: Apple Inc. [echo] Ant version: Apache Ant version 1.7.1 compiled on June 27 2008 [echo] Operating system name: Mac OS X [echo] Operating system architecture: x86_64 [echo] Operating system version: 10.6.6 [echo] Base directory: /Users/ldhanson2/tmp/groovy-1.7.6 [echo] Java Home: /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home [...] -stagedcompile-groovy: [groovyc] Compiling 166 source files to /Users/ldhanson2/tmp/groovy-1.7.6/target/classes [groovyc] org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed: [groovyc] Compile error during compilation with javac. [groovyc] /Users/ldhanson2/tmp/groovy-1.7.6/src/main/groovy/ui/InteractiveShell.java:222: cannot find symbol [groovyc] symbol : method setDefaultPrompt(java.lang.String) [groovyc] location: class jline.ConsoleReader [groovyc] reader.setDefaultPrompt("groovy> "); [groovyc] ^
The jline match is correctly resolved, but, oddly enough, the setDefaultPrompt method is not present in the bank:
$ javap -classpath target/lib/compile/jline-0.9.94.jar jline.ConsoleReader | grep setDefaultPrompt $
(Other methods are also missing in the javap output, but setDefaultPrompt is the one that breaks my assembly.)
I tried to destroy jline from my local maven repository and try again, but to no avail. I also checked the jarfile jline from Maven Central , as well as a mirror with the same results.
Oddly enough, I can copy the jar file to another machine (Sun) and follow the same steps, and I see the setDefaultPrompt method in the jar file, as expected. Others also followed the same steps on a Mac.
What can happen on my machine that prevents the Java toolchain from seeing the methods contained in the jar file?
java javap groovy macos jline
Lyle
source share