This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 179561 - Generated .exe for platform projects does not find 64-bit JDK/JRE
Summary: Generated .exe for platform projects does not find 64-bit JDK/JRE
Status: RESOLVED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: Launchers&CLI (show other bugs)
Version: 6.x
Hardware: PC Windows Vista
: P3 normal (vote)
Assignee: Antonin Nebuzelsky
URL:
Keywords:
: 184393 185177 (view as bug list)
Depends on:
Blocks:
 
Reported: 2010-01-15 12:19 UTC by mlopezro
Modified: 2010-04-28 12:49 UTC (History)
4 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Patch to fix the issue (untested) (4.37 KB, patch)
2010-01-15 14:09 UTC, dlipin
Details | Diff
Launcher files compiled with dlipin's patch applied (110.35 KB, application/octet-stream)
2010-03-12 11:02 UTC, Antonin Nebuzelsky
Details

Note You need to log in before you can comment on or make changes to this bug.
Description mlopezro 2010-01-15 12:19:58 UTC
I did the following:

1) Built a .zip for a Netbeans based-platform project.
2) On a different workstation with Vista 64bit + JDK 6 Update 17 64bit: Decompressed the .zip and tried to run the .exe that executes the application.
3) Got a "JDK 5.0 or newer cannot be found on your machine." dialog.

Seems that since the precompiled .exe is a 32bit executable, it only reads the 32bit part of the registry, therefore it can't get the path to the 64bit JRE/JDK automatically.

Remember we are talking about finalized applications an not the Netbeans IDE itself (although I guess it has the same problem), so this might be a big deal for end-users who want to run platform applications on Windows computers with 64-bit JREs (to allocate a bigger heap for example). Not all end users know they can change the .conf file to point to the proper JRE.
Comment 1 dlipin 2010-01-15 14:09:34 UTC
Created attachment 93343 [details]
Patch to fix the issue (untested)

Here is the proposed patch to fix the problem. Unfortunately I can`t test either that it works (no 64-bit environment available) but it compiles, at least and should give at least a way to go. The main thing is 
KEY_READ | (read64bit ? KEY_WOW64_64KEY)
Comment 2 Jaroslav Tulach 2010-03-10 03:06:10 UTC
Tondo, can you compile and test Dmitry's patch?
Comment 3 Antonin Nebuzelsky 2010-03-12 11:02:26 UTC
Created attachment 95105 [details]
Launcher files compiled with dlipin's patch applied

I have compiled nbexec.[exe&dll] with Dmitry's patch, but I have no way of testing x64 at the moment either.

It would be great if the reporter can test it and let us know how it works.

After the confirmation from the reporter I will ask QA to do validation too.
Comment 4 Stanislav Aubrecht 2010-03-30 13:55:49 UTC
i verified that the patched files work as expected in windows vista 64bit, jdk1.6.0_16 64bit
Comment 5 Antonin Nebuzelsky 2010-04-02 14:49:28 UTC
Stando, thanks for the confirmation.

Integrated:
http://hg.netbeans.org/core-main/rev/8da244e19bfa

mlopezro, I would like to hear your feedback too! Thanks.
Comment 6 mlopezro 2010-04-02 18:37:20 UTC
Thanks guys. I will try it as soon as I can.
Comment 7 Quality Engineering 2010-04-03 05:34:37 UTC
Integrated into 'main-golden', will be available in build *201004030201* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/8da244e19bfa
User: Antonin Nebuzelsky <anebuzelsky@netbeans.org>
Log: #179561: launcher does not find 64-bit JDK/JRE
Comment 8 mlopezro 2010-04-05 19:46:55 UTC
It works under Windows 7 64-bit with a 64-bit JDK.
Comment 9 Antonin Nebuzelsky 2010-04-19 10:14:40 UTC
*** Bug 184393 has been marked as a duplicate of this bug. ***
Comment 10 dlipin 2010-04-28 12:49:45 UTC
*** Bug 185177 has been marked as a duplicate of this bug. ***