question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Bug]: mvn compile fails because jdk.nashorn.api.scripting does not exist

See original GitHub issue

Related Template(s)

cdc-parent

What happened?

mvn clean compile fails probably because nashorn package is deprecated but google-cloud-teleport-java still uses it.

Beam Version

Newer than 2.35.0

Relevant log output

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.6.2:compile (default-compile) on project google-cloud-teleport-java: Compilation failure
[ERROR] /DataflowTemplates/src/main/java/com/google/cloud/teleport/templates/common/JavascriptTextTransformer.java:[38,33] package jdk.nashorn.api.scripting does not exist
[ERROR] 
[ERROR] -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.6.2:compile (default-compile) on project google-cloud-teleport-java: Compilation failure /DataflowTemplates/src/main/java/com/google/cloud/teleport/templates/common/JavascriptTextTransformer.java:[38,33] package jdk.nashorn.api.scripting does not exist

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

3reactions
pranavbhandari24commented, Apr 16, 2022

Nashorn was removed in JDK 15, so my guess is that you are using JDK 15 or above. It should work if you downgrade to using JDK 8/11.

0reactions
pranavbhandari24commented, Apr 16, 2022

Which java version are you using?

mvn -version should show which JVM maven uses (it may be not the one used when you simply type java)

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to make jdk.nashorn.api.scripting.JSObject visible in plugin
I have an Eclipse RCP that interacts with java script. Now with Java 8, nashorn is used and code that depended on org.mozilla.javascript...
Read more >
jdk.nashorn.api.scripting.NashornException Maven / Gradle / Ivy
jdk.nashorn.api.scripting.NashornException maven / gradle build tool code. The class is part of the package ➦ Group: com.xenoamess ➦ Artifact: nashorn ...
Read more >
Could not initialize class org.openjdk.nashorn.internal.runtime ...
Any small application with Java + Nashorn... EXPECTED VERSUS ACTUAL BEHAVIOR : EXPECTED - Should be executed JavaScript code without issues. ACTUAL -...
Read more >
569663 – Unable to build code using Nashorn with Java 11
Build works fine on Jenkins without it (just like on Travis CI, where this profile was not used as well), but it fails...
Read more >
JDK-8159037 JavaScript execution with Nashorn fails ... - Bug ID
raml1.java.patser.test. ... script.ScriptException: ReferenceError: "console" is not defined in <eval> at line number 5909 at jdk.nashorn.api.scripting.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found