简体   繁体   中英

Use OpenJML in Eclipse project that uses JDK different from OpenJDK 1.8

OpenJML is available as Eclipse Plugin (install site http://jmlspecs.sourceforge.net/openjml-updatesite ) and it seems to get installed OK in Eclipse Photon.

But docs say it shall run only on OpenJDK 1.8 and it cannot be any other JDK (say, Oracle JDK). Also it cannot be (OpenJDK) version different than 1.8 (say 1.9).

My Projects in Eclipse all use (Oracle) JDK, besides soon we plan upgrading from JDK 1.8 to 1.9.

Can I setup OpenJML so that it uses its wanted OpenJDK 1.8, while my project uses whatever it needs?

OpenJML builds upon the OpenJDK 1.8 Compiler internally. Of course, you can run OpenJML (with JRE 1.8) and the Java 9 compiler against the same Java sources (outside of eclipse; in a build tool), but OpenJML won't understand new language features (Modules, etc.) or API changes. So you need to stick with Java 1.8 API and features, hence besides of JVM improvements, you don't get any benefit of using Java 9.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM