apache / apache/netbeans

Unable to start remote debugging due to error "Unable to create javax script engine for javascript"

Open
#5,977 0 comments 0 reactions 0 assignees View on GitHub
Ant kind:bug needs:triage
Dominant language
Java
Stars
3.1k
Forks
935
Avg merge
2d 3h
Merged PRs (30d)
17

Description

### Apache NetBeans version

Apache NetBeans 17

### What happened

When I add a remote java platform to my project and try to debug my project using this remote java platform, I get the error "Unable to create javax script engine for javascript".

I am using NetBeans' bundled Ant (1.10.8 as of writing this report)

### How to reproduce

1. Create a new Java Ant Project (File -> New Project -> Java with Ant -> Java Application)
2. Add a new Configuration in the project properties
3. Add a new Remote Platform in the project properties (localhost:22 as remote target on NonWindows platforms can be used, too)
4. Start debugging the project using the Remote Platform defined before

NetBeans will crash in the "jar:" step, remote-project-impl.xml:129: Unable to create javax script engine for javascript

Workaround: Force NetBeans to use OpenJDK 11 as default platform instead of OpenJDK 17

### Did this work correctly in an earlier version?

Apache NetBeans 12.6 or earlier

### Operating System

macOS 13.4

### JDK

17.0.7, OpenJDK, aarch64

### Apache NetBeans packaging

Apache NetBeans provided installer

### Anything else

NetBeans uses by default the standard JDK if it does not come with a bundled JDK. In my case this is OpenJDK 17. When I use an older version of OpenJDK (by editing /Applications/NetBeans/Apache NetBeans 17.app/Contents/Resources/NetBeans/netbeans/etc/netbeans.conf the line netbeans_jdkome to point to OpenJDK 11), the issue will be gone. Instead I get another issue, for which I will create a separate bug report.

The rest of the IDE seems to run well using JDK 17 so I think it is generally compatible with JDK 17, right?

I also think that the Ant version that comes bundles with NetBeans 17 (Ant 1.10.8) is not compatible with OpenJDK 17 (Since Nashorn has been dropped with JDK 15; the most recent version of Ant does not have this problem anymore)

### Are you willing to submit a pull request?

No

Contributor guide

Open the contributing guide

Research direction

Start at remote-project-impl.xml:129 and compare the bundled Ant 1.10.8 behavior with the JDK 17 environment described in the report; the Nashorn removal is the reported compatibility clue. Reproduce the remote-platform debugging steps and consider the issue resolved when the project reaches the jar step without the JavaScript-engine error on JDK 17, without requiring JDK 11.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
build-system
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.