Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Browser is not found. UnsatisfiedLinkError (Windows, aarch64) #8218

Open
rockyAdmin opened this issue Jan 31, 2025 · 29 comments · May be fixed by #8224
Open

Browser is not found. UnsatisfiedLinkError (Windows, aarch64) #8218

rockyAdmin opened this issue Jan 31, 2025 · 29 comments · May be fixed by #8224
Labels
Contribution welcome An issue or feature not currently being worked on, but a contribution would be welcomed! kind:bug Bug report or fix needs:triage Requires attention from one of the committers os:windows web [ci] enable web job

Comments

@rockyAdmin
Copy link

rockyAdmin commented Jan 31, 2025

Apache NetBeans version

Apache NetBeans 24

What happened

no browsers show up in the browser dop down and the following silent error is produced and for existing project sometimes it also displays in the output window.

Exception:

java.lang.ExceptionInInitializerError: Exception java.lang.UnsatisfiedLinkError: C:\Program Files\Netbeans\netbeans-24\ide\modules\lib\extbrowser64.dll: Can't load AMD 64-bit .dll on a ARM 64-bit platform [in thread "org.netbeans.modules.web.clientproject.browser.ActiveBrowserAction"]
	at java.base/jdk.internal.loader.NativeLibraries.load(Native Method)
	at java.base/jdk.internal.loader.NativeLibraries$NativeLibraryImpl.open(NativeLibraries.java:331)
	at java.base/jdk.internal.loader.NativeLibraries.loadLibrary(NativeLibraries.java:197)
	at java.base/jdk.internal.loader.NativeLibraries.loadLibrary(NativeLibraries.java:139)
	at java.base/java.lang.ClassLoader.loadLibrary(ClassLoader.java:2444)
	at java.base/java.lang.Runtime.loadLibrary0(Runtime.java:916)
	at java.base/java.lang.System.loadLibrary(System.java:2063)
	at org.netbeans.modules.extbrowser.NbDdeBrowserImpl.<clinit>(NbDdeBrowserImpl.java:83)
	at org.netbeans.modules.extbrowser.SystemDefaultBrowser.createHtmlBrowserImpl(SystemDefaultBrowser.java:79)
	at org.netbeans.modules.extbrowser.SystemDefaultBrowser.detectSystemDefaultBrowser(SystemDefaultBrowser.java:166)
	at org.netbeans.modules.extbrowser.SystemDefaultBrowser.getPrivateBrowserFamilyId(SystemDefaultBrowser.java:158)
	at org.netbeans.modules.web.browser.api.WebBrowsers.getFactories(WebBrowsers.java:385)
	at org.netbeans.modules.web.browser.api.WebBrowsers.getPreferred(WebBrowsers.java:134)
	at org.netbeans.modules.web.browser.api.WebBrowser.refreshDelegate(WebBrowser.java:65)
	at org.netbeans.modules.web.browser.api.WebBrowser.<init>(WebBrowser.java:60)
	at org.netbeans.modules.web.browser.api.WebBrowser.createIDEGlobalDelegate(WebBrowser.java:106)
	at org.netbeans.modules.web.browser.api.WebBrowsers.createIDEGlobalDelegate(WebBrowsers.java:245)
	at org.netbeans.modules.web.browser.api.WebBrowsers.getUnsortedBrowsers(WebBrowsers.java:253)
	at org.netbeans.modules.web.browser.api.WebBrowsers.getAll(WebBrowsers.java:186)
	at org.netbeans.modules.web.browser.api.BrowserUISupport.findWebBrowserById(BrowserUISupport.java:228)
	at org.netbeans.modules.web.browser.api.BrowserUISupport.getDefaultBrowserChoice(BrowserUISupport.java:136)
	at org.netbeans.modules.web.project.WebProjectBrowserProvider.getActiveBrowser(WebProjectBrowserProvider.java:66)
	at org.netbeans.modules.web.clientproject.browser.ActiveBrowserAction.updateButton(ActiveBrowserAction.java:359)
	at org.netbeans.modules.web.clientproject.browser.ActiveBrowserAction.activeProjectChanged(ActiveBrowserAction.java:337)
	at org.netbeans.modules.web.clientproject.browser.ActiveBrowserAction.refreshView(ActiveBrowserAction.java:305)
	at org.netbeans.modules.web.clientproject.browser.ActiveBrowserAction.access$700(ActiveBrowserAction.java:88)
	at org.netbeans.modules.web.clientproject.browser.ActiveBrowserAction$8.run(ActiveBrowserAction.java:297)
Caused: java.lang.NoClassDefFoundError: Could not initialize class org.netbeans.modules.extbrowser.NbDdeBrowserImpl
	at org.netbeans.modules.extbrowser.ChromeBrowser.createHtmlBrowserImpl(ChromeBrowser.java:85)
	at org.netbeans.core.NbURLDisplayer.warmBrowserUp(NbURLDisplayer.java:100)
	at org.netbeans.core.NbURLDisplayer.access$000(NbURLDisplayer.java:47)
	at org.netbeans.core.NbURLDisplayer$1.run(NbURLDisplayer.java:59)
	at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1403)
	at org.netbeans.modules.openide.util.GlobalLookup.execute(GlobalLookup.java:45)
	at org.openide.util.lookup.Lookups.executeWith(Lookups.java:287)
[catch] at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:2018)

Language / Project Type / NetBeans Component

No response

How to reproduce

new surface pro with win jdk,-21 and win 11os and new install of
Netbeans -24 common zip version.

create new web project with ant: compile and run. Expect browser to load and display default index;

Did this work correctly in an earlier version?

No / Don't know

Operating System

win 11 on a surface pro

JDK

microsoft-jdk-21.0.6-windows-aarch64

Apache NetBeans packaging

Apache NetBeans binary zip

Anything else

problem happens everytime

Are you willing to submit a pull request?

No

@rockyAdmin rockyAdmin added kind:bug Bug report or fix needs:triage Requires attention from one of the committers labels Jan 31, 2025
@mbien
Copy link
Member

mbien commented Feb 1, 2025

win 11 on a surface pro

and

java.lang.ExceptionInInitializerError: Exception java.lang.UnsatisfiedLinkError: C:\Program Files\Netbeans\netbeans-24\ide\modules\lib\extbrowser64.dll: Can't load AMD 64-bit .dll on a ARM 64-bit platform [in thread "org.netbeans.modules.web.clientproject.browser.ActiveBrowserAction"]

sounds like some of the native libs don't support arm atm

if (org.openide.util.Utilities.isWindows()) {

Would be curious if it works if you set -J-Dorg.netbeans.modules.extbrowser.UseDesktopBrowse=true

@mbien mbien added the web [ci] enable web job label Feb 1, 2025
@rockyAdmin
Copy link
Author

I included the switch you suggested:

"Would be curious if it works if you set -J-Dorg.netbeans.modules.extbrowser.UseDesktopBrowse=true"

It had no effect.
Seems hard to believe something like this would no have been picked up before the release.

If I open the browser separately and call the localhost the it executes just fine. So it seems that everything wen fine through deployment.

@mbien
Copy link
Member

mbien commented Feb 1, 2025

Seems hard to believe something like this would no have been picked up before the release.

you are saying this worked before NB 24?

@matthiasblaesing
Copy link
Contributor

I did not yet look into what extbrowser64.dll really does, but if it is really "just" DDE, then there is an implementation in JNA, but the problem is: Everytime win-aarch64 comes up, all potential testers go away. The platform is a niche.

@rockyAdmin
Copy link
Author

No, I wasn't and didn't think with so many units sold it would be considered a niche. Since you mentioned it, I had a copy of v22 so I installed that and it does not work on v22. I use NB a lot, a lot and am required to use surface pro for other reasons. Is this something that would be corrected? Doesn't seem like there is a simple work around. Any other suggestions?

@matthiasblaesing
Copy link
Contributor

Any other suggestions?

You can create a patch and provide it here that protects NbDdeBrowserImpl from missing native libraries and/or ensure the native library is built for win-aarch64 or replaced with a pure Java implementation.

@neilcsmith-net
Copy link
Member

I'm somewhat surprised NetBeans even launches given we don't even build the launcher for aarch64. I assume the emulation is able to switch to the JDK architecture.

Right now, it's an unsupported platform. Contributions to making it supported would be welcome, but it needs contribution from someone with access to relevant hardware to test things.

@neilcsmith-net neilcsmith-net added the Contribution welcome An issue or feature not currently being worked on, but a contribution would be welcomed! label Feb 1, 2025
@mbien
Copy link
Member

mbien commented Feb 1, 2025

the stacktrace sounds like all it wants is to open a tab. I am wondering if basic functionality could be maintained by only using JDK api. That is why i wondered if -J-Dorg.netbeans.modules.extbrowser.UseDesktopBrowse=true would work.

@rockyAdmin
Copy link
Author

I am surprised you say it's unsupported, I found the configuration I used on stack trace. If you use the os installer version, then it doesn't work. According to stack trace, it is a supported configuration, and the zip version of NB was referred to as the common version as it is only supposed to rely on the JDK to run.

@rockyAdmin
Copy link
Author

Looking further into this unsupported conclusion, this is the most recent information I could find:

According to the latest information, Apache NetBeans 24 officially supports running on any chipset that can run a JDK 17 or higher, as the binary releases require JDK 17+ to function properly; meaning most modern processors across platforms like Intel, AMD, and ARM are supported.
Please comment.

@matthiasblaesing
Copy link
Contributor

Looking further into this unsupported conclusion, this is the most recent information I could find:

According to the latest information, Apache NetBeans 24 officially supports running on any chipset that can run a JDK 17 or higher, as the binary releases require JDK 17+ to function properly; meaning most modern processors across platforms like Intel, AMD, and ARM are supported.
Please comment.

What did you gain from this?

Apache NetBeans is user driven. There are currently no Windows-Aarch64 users here, that contribute. So no that combination is not supported. So why are you hairsplitting over a technicality? You want help, that is fine, acting as if you paid for it is not.

@neilcsmith-net
Copy link
Member

neilcsmith-net commented Feb 2, 2025

Apache NetBeans contains various native binaries to accomplish a few things. This includes the launcher exe used on Windows. As far as I know, none of our own native binaries for Windows are compiled with arm support.

I am slightly surprised that the launcher even works. As it obviously does mostly work for you, great! That is different to saying it's a supported configuration. We had the same situation with macOS arm for a while. I have access to one, so was able to help fix. To properly support Windows on arm will require contribution and testing from people.

With regard to the specific issue you're having, I agree with @mbien that the more things we can push to JDK APIs the better, and the easier to fully support more platforms.

EDIT : crossed replies with Matthias

@matthiasblaesing
Copy link
Contributor

Linaro documents a way to run Windows aarch64 (https://linaro.atlassian.net/wiki/spaces/WOAR/pages/28914909194/windows-arm64+VM+using+qemu-system). I'll see whether I can get it to work.

@rockyAdmin
Copy link
Author

matthiasblaesing: you are reading into my comment. My intent was definitely not to be hairsplitting or acting like I am paying for support. My post was to show what is currently the public marketed position is and that non-technical management believes. Do to this I am dealing with a belief that now I am the problem. I am not the technical person that could help make these types of changes, but I am able, reliable and willing to test.
I ran the install on laptops x86 side by side with arm.

  1. the default install with no changes to the config file on the arm cannot find the jdk
    at all. it provides a java 1.8 or higher error. Seems it cannot find JAVA_HOME.
    Testing from the command line JAVA_HOME is found just fine. I activated the
    config setting:
    "netbeans_jdkhome=C:\Program Files\Java\jdk-21"
    At this point the launcher finds the jdk and runs smoothly.
  2. I then loaded a fair size javaee project and tested all internal editing, compile and build. No obvious problem It worked like x86.
  3. The only ui feature that had a problem is the drop down for browser selection no browser options are loaded at all. I assume this is done by the launcher from the os which also which must get JavaHome from the system.

It may be the only issue is how the launcher accesses the win os from the launcher.
I am willing to provide whatever assistance I can.

@mbien
Copy link
Member

mbien commented Feb 3, 2025

My intent was definitely not to be hairsplitting or acting like I am paying for support. My post was to show what is currently the public marketed position is and that non-technical management believes. Do to this I am dealing with a belief that now I am the problem

Project maintainers are trying to explain to you that arm/windows is not a fully supported platform, while you are somehow trying to argue that it is supported.

This issue contains now sufficient information to allow someone who is interested in and/or with access to the given platform to work on resolving it. If the discussion continues to derail like this I will lock this thread for committers and collaborators only.

@neilcsmith-net
Copy link
Member

My post was to show what is currently the public marketed position is and that non-technical management believes.

I am somewhat amused by the idea that we have either marketing or non-technical management! 😆

@rockyAdmin thank you for the offer of help in testing. We likely still need someone with technical skills and the target platform to contribute here. No one is going to break your current workflow, just expect some rough edges.

There is a small, mostly volunteer, team developing and maintaining the IDE. The people who wrote that download web page are the same people telling you that this platform is not fully supported! Another non-technical contribution would be to look at clarifying the level of support for various platforms on the download page https://github.com/apache/netbeans-antora-site/edit/main/modules/ROOT/pages/download/nb24/index.adoc

@neilcsmith-net neilcsmith-net changed the title Netbeans 24: browser is not found. UnsatisfiedLinkError Browser is not found. UnsatisfiedLinkError (Windows, aarch64) Feb 3, 2025
@rockyAdmin
Copy link
Author

Once again, I will clarify, was referring to my management not yours and all public information produced by an organization NB in this case is marketing and sets the expectations of decision makers. I understand your staffing and internal technical position to address this issue, and I would like to thank you for spending your time on this thread. Should you find the technical part of the equation my offer to test stands.
Thank all of you for your time.

@rockyAdmin
Copy link
Author

I reviewed past issues with the launcher and the win dll that were located on github. The dll is just a rats nest, so I read the propaganda on JNA. Turns out we are in luck it does what is says it will. I took some time this morning and created a working
example with JNA its only dependency is:
com.sun.jna.platform_5.13.0.jar

In this draft i do the following things:

  1. read the win registry - get the product name
  2. Simulate the NB UI browser drop-down - loading the available browsers from the win reg.
  3. Simulate the user selection from the drop down : see var "NBBrowserSelected"
  4. launch the browser.

Runs fast and smooth on my laptop. All things being equal I should be able to just send you this one file and it should run as is on your x64 windows machine. This may provide you with the base if not a starting point of what you need to scrap the dll.
Still trying to help.

@matthiasblaesing
Copy link
Contributor

matthiasblaesing commented Feb 4, 2025

@rockyAdmin thanks for further looking into this. The interesting bit will be integration into the existing classes. But ignoring everything else you verified, that the JNA libraries actually work on win-aarch64, that should have been the case, but geting the info first hand is nice. Thank you!

I experiented a bit with this the last two hours and initially I thought I broke the DDE client, until I realized, that neither Edge, nor Firefox support DDE anymore and while switching from the c++ code to java code I removed some exception guards I'll need to readd.

Unfinished/only preliminary tessted branch: matthiasblaesing@33eafba

matthiasblaesing added a commit to matthiasblaesing/netbeans that referenced this issue Feb 4, 2025
…ontrol

This reduces the amount of native code that needs to be shipped with
NetBeans and allows to support running on more platforms.

Closes: apache#8218
@rockyAdmin
Copy link
Author

If you can make the launcher code available for me to review., maybe I can be more helpful then I first thought. I do have time available now for you. Also how would you like me to transmit the working win-reg code to you. Should I just paste it here?

matthiasblaesing added a commit to matthiasblaesing/netbeans that referenced this issue Feb 5, 2025
This reduces the amount of native code that needs to be shipped with
NetBeans and allows to support running on more platforms.

The DDE based control was completely removed as in tests MS Edge,
Google Chrome and Mozilla Firefox all did not support DDE.

Closes: apache#8218
matthiasblaesing added a commit to matthiasblaesing/netbeans that referenced this issue Feb 5, 2025
This reduces the amount of native code that needs to be shipped with
NetBeans and allows to support running on more platforms.

The DDE based control was completely removed as in tests MS Edge,
Google Chrome and Mozilla Firefox all did not support DDE.

Closes: apache#8218
@matthiasblaesing
Copy link
Contributor

@rockyAdmin could you have a look at PR #8224. After noticing that DDE does not work with any modern browser and all tested browsers run fine via command line invocation, I ripped out all of the DDE support.

A testbuild is available from https://github.com/apache/netbeans/suites/33993818897/artifacts/2543615585

I tested:

  • Linux-amd64: Firefox and Chrome start fine
  • Windows-amd64: Edge, Firefox, Chrome and Opera start fine

@rockyAdmin
Copy link
Author

rockyAdmin commented Feb 6, 2025 via email

@mbien
Copy link
Member

mbien commented Feb 6, 2025

@rockyAdmin the artifact might be gone already. But you can get to the dev build artifact by opening the summary page of the PR workflow run and scrolling to the bottom: https://github.com/apache/netbeans/actions/runs/13166253240?pr=8224

@matthiasblaesing
Copy link
Contributor

@rockyAdmin sorry, I think I screwed that. One of the unittests failed and I restarted them. Right link: https://github.com/apache/netbeans/suites/33993818897/artifacts/2547867181

@rockyAdmin
Copy link
Author

rockyAdmin commented Feb 6, 2025 via email

@matthiasblaesing
Copy link
Contributor

@rockyAdmin thank you. So I understand, that you tested on windows arm64 and tested a setup like you described in the original text? So the browser was correctly opened and it was the correct browser?

@rockyAdmin
Copy link
Author

rockyAdmin commented Feb 6, 2025 via email

@rockyAdmin
Copy link
Author

rockyAdmin commented Feb 7, 2025 via email

@neilcsmith-net
Copy link
Member

Thanks for testing.

It also had and issue not finding the JaveHome setting and having to declare it in the config file.

This is a known problem with the launcher code on Windows, and not related to this issue. It requires the JDK to be set. The current ASF installer writes the JDK location into the config file for you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Contribution welcome An issue or feature not currently being worked on, but a contribution would be welcomed! kind:bug Bug report or fix needs:triage Requires attention from one of the committers os:windows web [ci] enable web job
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants