我在下面有maven-compiler-plugin设置:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
<compilerArguments>
<bootclasspath>${java.home}/lib/rt.jar;${java.home}/lib/jce.jar</bootclasspath>
</compilerArguments>
</configuration>
</plugin>
执行mvn compile
时,会报告Unable to find package java.lang in classpath or bootclasspath
。但我确实在java.lang
中找到了/Library/Java/JavaVirtualMachines/jdk1.8/Contents/Home/jre/lib/rt.jar
个包:
java/lang/Thread$UncaughtExceptionHandler.class
java/lang/ThreadGroup.class
java/lang/Runnable.class
java/lang/Thread.class
java/lang/ref/Finalizer.class
java/lang/ref/PhantomReference.class
java/lang/ref/FinalReference.class
java/lang/ref/WeakReference.class
java/lang/ref/SoftReference.class
java/lang/ref/Reference.class
......
我在OS X 10.11.3上使用Oracle JDK 1.8。我应该提供哪些额外信息?问题来自JDK还是项目的maven设置?
编辑:
export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8/Contents/Home
EDIT2:
与Maven : unable to find java.lang issue on OS X不同,我正在使用 Oracle JDK
EDIT3:
maven版
Apache Maven 3.3.9 (bb52d8502b132ec0a5a3f4c09453c07478323dc5; 2015-11-11T00:41:47+08:00)
Maven home: /usr/local/Cellar/maven/3.3.9/libexec
Java version: 1.8.0_60, vendor: Oracle Corporation
Java home: /Library/Java/JavaVirtualMachines/jdk1.8.0_60.jdk/Contents/Home/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "mac os x", version: "10.11.3", arch: "x86_64", family: "mac"
/Library/Java/JavaVirtualMachines/jdk1.8/Contents/Home
是指向maven版本信息
/Library/Java/JavaVirtualMachines/jdk1.8.0_60.jdk/Contents/Home
的软链接
答案 0 :(得分:5)
loc.findById(req.params.locationid)
.populate('lessons', null, {_id: "56d4b687c4bcb5681a870cb4"})
.exec(function (err, location) {
});
已被弃用,但这不是它无效的原因。仅当<compilerArguments>
设置为<fork>
时,这些类型的参数才有效。
这对我有用:
true