Description
The error is:
.java is not on the classpath of project xxxx, only syntax errors are reported
Environment
- Operating System: MacOs, Catalina 10.15.7
- JDK version:
openjdk version "11.0.9" 2020-10-20 LTS
OpenJDK Runtime Environment Zulu11.43+21-CA (build 11.0.9+11-LTS)
OpenJDK 64-Bit Server VM Zulu11.43+21-CA (build 11.0.9+11-LTS, mixed mode)
- Visual Studio Code version: 1.55.2
- Java extension version: 0.76.0
Steps To Reproduce
- Import Gradle project
- Open .java file
Here are some other messages that I get:
Could not run phased build action using connection to Gradle distribution 'https://services.gradle.org/distributions/gradle-6.4.1-all.zip'.
The newly created daemon process has a different context than expected.
It won't be possible to reconnect to this daemon. Context mismatch:
Java home is different.
Wanted: DefaultDaemonContext[uid=null,javaHome=/nix/store/g4lwpql3c2lyw7m04wxbrx72x9kh0w9j-zulu11.43.21-ca-jdk11.0.9,daemonRegistryDir=/Users/xxxxx/.gradle/daemon,pid=49638,idleTimeout=null,priority=NORMAL,daemonOpts=--add-opens,java.base/java.util=ALL-UNNAMED,--add-opens,java.base/java.lang=ALL-UNNAMED,--add-opens,java.base/java.lang.invoke=ALL-UNNAMED,--add-opens,java.prefs/java.util.prefs=ALL-UNNAMED,-XX:MaxMetaspaceSize=256m,-XX:+HeapDumpOnOutOfMemoryError,-Xms256m,-Xmx512m,-Dfile.encoding=utf8,-Duser.country=GB,-Duser.language=en,-Duser.variant]
Actual: DefaultDaemonContext[uid=415ee891-9ddf-491a-a2cb-c7cee384bfab,javaHome=/nix/store/g4lwpql3c2lyw7m04wxbrx72x9kh0w9j-zulu11.43.21-ca-jdk11.0.9/zulu-11.jdk/Contents/Home,daemonRegistryDir=/Users/xxxxx/.gradle/daemon,pid=49652,idleTimeout=10800000,priority=NORMAL,daemonOpts=--add-opens,java.base/java.util=ALL-UNNAMED,--add-opens,java.base/java.lang=ALL-UNNAMED,--add-opens,java.base/java.lang.invoke=ALL-UNNAMED,--add-opens,java.prefs/java.util.prefs=ALL-UNNAMED,-XX:MaxMetaspaceSize=256m,-XX:+HeapDumpOnOutOfMemoryError,-Xms256m,-Xmx512m,-Dfile.encoding=utf8,-Duser.country=GB,-Duser.language=en,-Duser.variant]
Additional Informations
I am also trying to get Emacs work with this project. I have lots of NullPointerExceptions from the plugins in the lsp-log there.
I've read that Gradle projects for Android are not supported. Well, this one is not for Android.
Here is what I put in build.gradle:
plugins {
id 'java'
id 'eclipse'
id 'idea'
...
I also put this (to have the classes copied in bin and not only in the build directory:
task copyBuildToBin(type: Copy) {
from 'build/classes/java/'
from 'build/resources/'
into 'bin/'
}