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

build.xml and run.xml: fixed detection of 64 bit architecture for Java 9+ (on Windows) #3522

Merged
merged 1 commit into from Jan 28, 2022

Conversation

DevCharly
Copy link
Member

When using Java 9+ for debugging/running NetBeans from NetBeans on Windows,
then the 64-bit architecture of the JVM was not detected correctly and
netbeans.exe was used instead of netbeans64.exe to launch NetBeans.
This affects not only NetBeans core development, but also NetBeans module development.

This PR detects 32-bit JVMs and otherwise defaults to 64-bit.

See https://lists.apache.org/thread/5v5gb40tj3t4y06qtzxhjncowtm290t1

@lkishalmi lkishalmi added this to the NB13 milestone Jan 27, 2022
@neilcsmith-net
Copy link
Member

@lkishalmi busy adding milestones as I'm reading 😄 From a NetBeans 13 perspective, happy to merge, but wouldn't mind review from someone who actually uses this more (I use Windows rarely) given we're late in the day.

Copy link
Member

@mbien mbien left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like that 64bit is now the default, makes it less likely that this will break again.

The file probe however only checks windows dlls. Unfortunately I don't think this same trick will work on linux for example since it doesn't use the bridge libs. Still +1 from me since it makes the situation better.

edit: its probably not needed on linux since the launcher is a shell script and doesn't rely on the property i suppose

@lkishalmi
Copy link
Contributor

@neilcsmith-net Just saw this one requested against the delivery branch, so I've added you as a reviewer and set the milestone to NB13. The choice is in your hands.

Also, I'm not a Windows user as well.

@DevCharly
Copy link
Member Author

The file probe however only checks windows dlls.

@mbien the Ant property jvm.arch.string, which this PR affects, is used only for the Windows "exe" launcher.
Also think that the old check works only on Windows because it uses backslash in the path.

Anyway, compared 32bit and 64bit Linux builds of Zulu and Bellsoft:

  • Java 8: 32bit has directory jre/lib/i386, 64bit has jre/lib/amd64 (Java 11 and 17 do not have these dirs)
  • Java 11 and 17: have not found a file/directory to detect 32bit

For macOS I have not found 32bit builds.

@mbien
Copy link
Member

mbien commented Jan 27, 2022

@DevCharly yeah I agree its not needed to cover all cases here since the property is only used on windows.

@neilcsmith-net
Copy link
Member

Thanks @DevCharly , and @mbien for review - merging.

@neilcsmith-net neilcsmith-net merged commit 297486a into apache:delivery Jan 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants