问题
I have a project which builds fine under gradle
as well as in the IntelliJ
IDE run configuration.
But it gives a problem in the VSCode
IDE:
The package javax.crypto is accessible from more than one module
The are no module-info.java
file in the entire project.
The modules listed are:
~/Desktop/dev/projects/pid2 % java --list-modules
java.*
jdk.*
The VSCode
home setting for the JDK is:
"java.home": "/Users/stephane.eybert/.sdkman/candidates/java/current",
and it is the version:
~/Desktop/dev/projects/pid2 % /Users/stephane.eybert/.sdkman/candidates/java/current/bin/java -version (master)pid2
openjdk version "11.0.2" 2019-01-15
OpenJDK Runtime Environment 18.9 (build 11.0.2+9)
OpenJDK 64-Bit Server VM 18.9 (build 11.0.2+9, mixed mode)
I tried with changing the JDK so as to use the same one as IntelliJ
is using, but the problem remained the same.
The IntelliJ
JDK version is:
~/Desktop % /Applications/IntelliJ\ IDEA.app/Contents/jbr/Contents/Home/bin/java -version
openjdk version "11.0.4" 2019-07-16
OpenJDK Runtime Environment (build 11.0.4+10-b304.77)
OpenJDK 64-Bit Server VM (build 11.0.4+10-b304.77, mixed mode)
The VSCode version is:
Version: 1.40.0
Commit: 86405ea23e3937316009fc27c9361deee66ffbf5
Date: 2019-11-06T17:09:34.601Z
Electron: 6.1.2
Chrome: 76.0.3809.146
Node.js: 12.4.0
V8: 7.6.303.31-electron.0
OS: Darwin x64 19.0.0
来源:https://stackoverflow.com/questions/58873562/the-package-is-accessible-from-more-than-one-module-problem-under-vscode-only