How to use Nashorn in Java 15 and later?

According to JEP 372, Nashorn had been removed from JDK 15 but you can get latest nashorn from https://search.maven.org/artifact/org.openjdk.nashorn/nashorn-core/15.0/jar For Maven, include the below dependency into your pom.xml <dependency> <groupId>org.openjdk.nashorn</groupId> <artifactId>nashorn-core</artifactId> <version>15.0</version> </dependency> For Gradle, include dependency below into your build.gradle implementation ‘org.openjdk.nashorn:nashorn-core:15.0’ Unfortunately, Standalone Nashorn is only usable as a JPMS module. So you … Read more