I'm using Visual Studio Code 1.4.3 on Ubuntu 19.10 with Maven 3.6.3 and GraalVM graalvm-ce-java11-20.0.0. The static analysis of my java project gives me this error:
The package org.graalvm.polyglot is accessible from more than one module: <unnamed>, org.graalvm.sdk
I don't know which package does <unnamed>
refer to and where to look to solve the "double import" problem.
N.B.: this error does no happen if I compile my project directly using mvn
from terminal, but this actually seems to be a bug of the javac compiler, see this issue.
UPDATE
The above error is raised by Visual Studio Code in each source file where I import something from org.graalvm.polyglot
(e.g., import org.graalvm.polyglot.Value;
) and my $CLASSPATH
variable is currently empty.
UPDATE
Currently inside pom.xml
I have
<dependency>
<groupId>org.graalvm.sdk</groupId>
<artifactId>graal-sdk</artifactId>
<version>${graalvm.version}</version>
</dependency>
<dependency>
<groupId>org.graalvm.truffle</groupId>
<artifactId>truffle-api</artifactId>
<version>${graalvm.version}</version>
</dependency>-->
By trial and errors I hav found that I need to remove both dependencies in order to get rid of the error above, but in this way I get an import error for anything inside com.oracle.truffle
(e.g., The import com.oracle.truffle.api cannot be resolved
)
UPDATE:
Running mvn clean package install -DskipTests
from terminal compiles the project without any complaint.