我想要处理一个无法解析所有依赖项的类,但得到了以下错误:
Exception in thread "main" spoon.compiler.ModelBuildingException: The import org.apache.commons cannot be resolved at /home/elmarce/PROJECTS/DATA/SOURCE/openimaj-master/core/core-image/src/main/java/org/openimaj/image/ImageUtilities.java:55
at spoon.support.compiler.jdt.JDTBasedSpoonCompiler.report(JDTBasedSpoonCompiler.java:665)
at spoon.support.compiler.jdt.JDTBasedSpoonCompiler.reportProblems(JDTBasedSpoonCompiler.java:646)
at spoon.support.compiler.jdt.JDTBasedSpoonCompiler.build(JDTBasedSpoonCompiler.java:127)
at spoon.support.compiler.jdt.JDTBasedSpoonCompiler.build(JDTBasedSpoonCompiler.java:108)
at spoon.Launcher.buildModel(Launcher.java:703)
at fr.inria.diversify.syringe.SyringeInstrumenterImpl.instrument(SyringeInstrumenterImpl.java:147)
at fr.inria.heavyloops.Main.main(Main.java:114)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:147)我想我记得在之前的Spoon版本中,使用env.useSourceCodeFragments(true);可以做到这一点,但在Spoon5.2中,我不知道该怎么做。
发布于 2016-08-16 20:10:40
您应该使用noclasspath模式:
spoon.getEnvironment().setNoClasspath(true);https://stackoverflow.com/questions/38973366
复制相似问题