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 141648 - Incorrect JDK detection in setup
Summary: Incorrect JDK detection in setup
Status: RESOLVED WONTFIX
Alias: None
Product: installer
Classification: Unclassified
Component: Code (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: issues@installer
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-07-25 07:43 UTC by Peter Nabbefeld
Modified: 2008-08-14 11:19 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
screenshot from 6.5 installer - jdk 1.5.0_14 and _15 listed (35.69 KB, image/jpeg)
2008-07-25 10:30 UTC, Lukas Hasik
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Peter Nabbefeld 2008-07-25 07:43:52 UTC
Setup uses the first jdk 1.5 or jdk 1.6 installation it can find, not the most up-to-date, e.g. for 1.6 it finds 1.6.0
but not 1.6.0_06. This leads to incorrect installation of the buggy JDK. In general, the setup should either find *all*
JDKs (and show the latest one per default), or it should only find the latest one (but must not ignore the current
1.6.0u10 beta). However, it may not use the first version found, as this is not a reliable detection (and may cause bugs).
Comment 1 Lukas Hasik 2008-07-25 09:01:39 UTC
setup means installer? IMO, installer lists all found JDKs in a combobox
Comment 2 Peter Nabbefeld 2008-07-25 09:40:50 UTC
Yes. JDKs are usually found, but it seems, if one JDK has been found for some category (e.g. 1.6.0), the installer
doesn't look for other path releases.
Comment 3 Lukas Hasik 2008-07-25 10:28:02 UTC
reassigning to installer to evaluate. However it seems working correctly for my jdks 1.5 (look at screenshot)
Comment 4 Lukas Hasik 2008-07-25 10:30:23 UTC
Created attachment 65624 [details]
screenshot from 6.5 installer - jdk 1.5.0_14 and _15 listed
Comment 5 dlipin 2008-07-25 10:45:23 UTC
epdv, could you please give more specific info?
which particular versions of JDK do you have installed?
what are their paths?

By design, installer finds all JDKs that it could find in commonly used paths, Windows registry and specific 
environment variables (JAVA_HOME, JAVAHOME, JDKHOME and such). By design, briefly it selects JDK due to the following 
rules:
- if any JDK has already been used by previous versions of the NetBeans installed, then use it
- if not then get the latest one

Please attach the recent installation log available at %USERPROFILE%/.nbi/log.

But if we talk about the Java that installer _starts on_ then, yes, by design, it starts on the first suitable Java it 
could find (for windows, minimum version is now 1.5.0_06). This is done mostly intentionally - installer runs fine on 
almost any JDK5 and JDK6 - so we use the first one we could find so that not to waste time to find all the others in 
order to find the latest. Afaik there is no much JDK bugs that installer suffer from and because of which we should use 
e.g. 1.6.0_06 and not 1.6.0_05. 
Comment 6 Peter Nabbefeld 2008-07-25 11:56:55 UTC
I'll go to check the installation more in depth and especially the nbi file (thanks for providing the info) probably at
the weekend. I'll also go to check the registry (Could You probably tell me, which paths to check? If You know, life
will be easier for me - and returned info will be more reliable). The fact is, that I've used the installer and it used
1.6.0 instead of 1.6.0_06. This is a problem, as XML parsing is buggy in 1.6.0.

dlipin, from Your info I understand, the installer is probably using the buggy JDK just because it has been used
earlier, so probably it should probably forbid this version? For further information, see also
http://www.netbeans.org/issues/show_bug.cgi?id=140905http://www.netbeans.org/issues/show_bug.cgi?id=140905
Comment 7 dlipin 2008-07-25 12:06:34 UTC
> I'll also go to check the registry (Could You probably tell me, which paths to check? 
HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Development Kit
HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Runtime Environment
Comment 8 dlipin 2008-07-25 14:18:36 UTC
I don`t think that we should reject jdk 1.6.0_10 even though it has the issue. It is better to file (or reopen 
existing) JDK bug so that they fix it before 1.6.0_10 becomes FCS (now it is in RC quality).
Comment 9 Peter Nabbefeld 2008-07-25 15:49:30 UTC
@dlipin: I haven't seen the bug with 1.6.0_10 (I didn't use it for IDE installation), but with 1.6.0 (You could say
1.6.0_00) - that's the one which should be "forbidden" IMO.
Comment 10 Peter Nabbefeld 2008-07-26 08:57:15 UTC
@dlipin: Installed latest build, that's what the installer shows for JDK:
   JDK 1.5.0_...
   JDK 1.6.0 (used by IDE)
   JDK 1.6.0_06
The problem is: The JDK used by IDE is the default selection. There should be a warning/error message about usage of
1.6.0, as the XML parser of this JDK is known to be buggy (see
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6531160, as Jesse pointed out in bug #140905)
Comment 11 dlipin 2008-07-26 18:19:28 UTC
epdv,

To bew honest, each JDK version has a number of bugs
http://java.sun.com/javase/6/webnotes/ReleaseNotes.html

So I see no reason why this particular bug (6531160/140905) - moreover with such a lower (P4) priority - has the 
preference over the others.
Following your logic, we should forbid 1.6.0, 1.6.0_01... 1.6.0_06 as well since these updates also has bugs that 
affects NetBeans work, right?

The thing that I suggest (and see it reasonable) to do is to change to logic of choosing the default JDK.
I think that in such a situation (JDK 1.5.0_..., JDK 1.6.0 (used by IDE), JDK 1.6.0_06) we should choose the 1.6.0_06 
and should not take into account that 1.6.0 is already used by the the IDE instance installed.

What do you think on that?

The only questionable situation is e.g. the following:
1.5.0_15
1.6.0
1.6.0_10 (beta or release candidate)
or either
1.5.0_15
1.6.0
1.7.0 (Early Access)

In this situations I can`t say for sure what version we should choose.. 
In the first case, likely 1.6.0_10, in second - likely 1.6.0.

Anyway, we should not miss the information that user choose some particular version before.
Even though it is now not the latest version, the user selected it one so likely he has some reasons to use it.
Comment 12 Peter Nabbefeld 2008-07-27 12:07:02 UTC
dlipin,

the problem is not, that the JDK has bugs - the problem is, that the bug caused a P1 bug (couldn't create projects!).
I've  set it to P4 after it seemed not to affect many people, and as it became clear that it would probably a JDK bug.
JDKs which cause serious bugs in the IDE should be handled as too buggy to use them. BTW: Probably there should be an
easy-to-find page informing about those buggy JDKs (e.g. on netbeans.org home or accessible from this)?
Comment 13 dlipin 2008-08-14 11:18:43 UTC
Since the Issue 140905 is fixed, I see no reason to fix this one.
Comment 14 dlipin 2008-08-14 11:19:53 UTC
->wontfix.