INRIA / INRIA/spoon

Is it possible to parse Java code using another JDK than the one running Spoon?

Open
#4,879 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
2k
Forks
392
Avg merge
11h 24m
Merged PRs (30d)
36

Description

Hello,

I'm wondering if it is possible to parse Java code using another JDK than the one running Spoon?

For instance, I've developed a program called Javanalyser that parse Java code with the help of Spoon, it is based on Java 11 with its features and its JDK of course.

But when I'm parsing old Java 8 code, it happens that Spoon do not recognize some methods from Java that have change over time, for example:
- Java 8 includes a deprecated method checkTopLevelWindow in the SecurityManager (https://docs.oracle.com/javase/8/docs/api/java/lang/SecurityManager.html#checkTopLevelWindow);
- Java 11 does not have this method in its SecurityManager (https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/SecurityManager.html)

To use the JDK from Java 8 I had to build and run Javanalyser with Java 8, simply put:
Is it possible to directly use JDK 8 when running Spoon with Java 11 ?

Thanks in advance for your help,

Great work,
I love Spoon!

Cheers,
Sébastien Bertrand.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.