How to add JDK ≥ 9 modules as dependencies #1375
ayanamists
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
It's not a bug.
I'm using JDT as a library instead of run a eclipse container, so I can't make use of apis like
IJavaProject
. Currently, I could set my jar dependencies byASTParser::setEnvironment
function. For example:By including all JARs (especially,
rt.jar
) incp
, JDT can correctly parse/resolve my java source file. However, since Java 9, the JDK uses modules to distribute the JRE, and there are no longer such JARs asrt.jar
.I found two workarounds:
includeRunningVMBootclasspath
flag ofsetEnvironment
to true, so that JDT will use the current JVM's JRE.However, I want to know if there's way to add a JRE module as a dependency of
ASTParser
? Just like includert.jar
in the classpath (cp
).Beta Was this translation helpful? Give feedback.
All reactions