NetBeans 19 Java 17 Remote Debugging Raspberry Pi Not Working Without Nashorn

179 views Asked by At

I'm trying to upgrade a development environment from NetBeans 12.6 to 19 and Java 11 to 17 on Windows 10. This environment supports an application targeted to both Windows and Raspberry Pi OS.

After upgrading Java and NetBeans, remote debugging on the Raspberry Pi from Windows (breakpoints, etc.) no longer works. Running the application remotely on the Raspberry Pi from Windows does still work.

When I attempt a debugging action in NetBeans with the Raspberry Pi platform and configuration selected, I receive the following message:

"Java 15 has removed Nashorn, you must provide an engine for running JavaScript yourself. GraalVM JavaScript currently is the preferred option."

I understand that Nashorn was remoted in Java 15. What I don't understand is what to do about it.

I assume NetBeans is looking for a Nashorn replacement on the Windows system hosting NetBeans and not the Raspberry Pi, but I am not completely certain.

This NetBeans project uses Ant. I read that upgrading Ant to the latest version (from 1.10.8 to 1.10 14) might resolve this issue, but that did not work. I also tried installing GraalVM on Windows 10 and enabling options --experimental-options --js.nashorn-compat=true in NetBeans. That also did not work.

My goal is NetBeans 19 and Java 17 on Windows 10 with the ability to both run and debug on both Windows 10 and Raspberry Pi OS. Earlier versions of NetBeans and Java made this very easy.

I am not committed to Ant but, as far as I can tell, Maven and Gradle do not provide a similar remote run / debug capability. But I'm open to switching to a different build system if that resolves my issue. I'm even willing to consider switching to a different IDE, if necessary.

If you have information that would help me, please be as specific as you can. My expertise is in the application domain and the Java language, not NetBeans, Nashorn, etc.

1

There are 1 answers

1
Blaine On

I'm posting an answer to my own question that is, at best, a poor answer. I'm continuing to use NetBeans 19, but I've reverted to Java 11.

In doing this I initially had a different problem with remote debugging that was previously documented at https://github.com/apache/netbeans/issues/5979 and https://issues.apache.org/jira/browse/NETBEANS-1425 .

The solution posted in issue #1425, to add a definition for debug-args-line to build.xml, did resolve that problem for me in NetBeans 19 on Windows 10.

So I can once again both run and debug my application on both Windows 10 and Raspberry Pi OS. But I must use Java 11 (or presumably any Java < 15 with Nashorn) to achieve that.