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 99745 - Netbeans should detect new JDK home
Summary: Netbeans should detect new JDK home
Status: RESOLVED FIXED
Alias: None
Product: ide
Classification: Unclassified
Component: Code (show other bugs)
Version: 6.x
Hardware: All Windows Vista
: P3 blocker with 1 vote (vote)
Assignee: _ rkubacki
URL:
Keywords:
: 102858 (view as bug list)
Depends on:
Blocks:
 
Reported: 2007-04-03 05:44 UTC by t800t8
Modified: 2007-07-16 12:53 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description t800t8 2007-04-03 05:44:40 UTC
Netbeans should detect new JDK home if the new one is different from the old one.
Comment 1 _ rkubacki 2007-04-03 14:06:44 UTC
What does it mean 'new JDK home'? What is the result of such detection?
Comment 2 t800t8 2007-04-03 14:51:07 UTC
If I upgrade to newer version of JDK, Netbeans cannot start 'cause the JDK
folder it is changed. Example: the old one is "C:\Program
Files\Java\jdk1.6.0_01", but the new one is "C:\Program Files\Java\jdk1.6.0_02".

At this time I cannot start Netbeans and it only shows a message that it cannot
find java.exe.
Comment 3 _ rkubacki 2007-04-03 15:11:41 UTC
What version of NB do you have? According to this bug report it is some 6.0
build OTOH this should be fixed there and if netbeans.conf refers to
non-existing JDK dir a suitable one found in Windows registry will be used.
Comment 4 t800t8 2007-04-03 15:33:32 UTC
I have this problem with M8.
Comment 5 shamatt 2007-04-13 00:41:12 UTC
I have this problem with NB 5.5 on WinXP.  It took me a while to figure out
where this setting was stored because Windows search wasn't finding "1.6.0" in
the right files.  I used the NB FAQ and discovered it in:

C:\Program Files\netbeans-5.5\etc\netbeans.conf

# default location of J2SE JDK, can be overridden by using --jdkhome <dir> switch
netbeans_jdkhome="C:\Program Files\Java\jdk1.6.0_01"

It may also be in C:\Documents and Settings\%user%\.netbeans\5.5...

At a minimum I would recommend a better error message pointing the user to the
netbeans.conf file.

Better would be to implement the same search and selection feature used in the
NB installer if no JDK is found at the netbeans_jdkhome location.  Anyone
upgrading JDK's is going to run into this issue and it would be nice if NB could
help them out more.

I would mark this as a feature rather than defect (unless there really is
registry search code that exists but is not working).
Comment 6 _ rkubacki 2007-06-14 14:33:42 UTC
Well. Previous patch helped if there was no jdkhome specified in netbeans.conf. Now it ignores jdkhome from .conf file
or from command line if it refers to a directory with no java.exe. It means case of this bug should be fixed.

OTOH it would be easier to revert this and have uninitialized jdkhome in netbeans.conf on Windows. That way we can
always rely on Windows registry to get appropriate JDK. JDK upgrade would work too and behavior of launcher could be
transparent (it is not after this patch).

Checking in nbexec.cpp;
/shared/data/ccvs/repository/core/launcher/windows/nbexec.cpp,v  <--  nbexec.cpp
new revision: 1.31; previous revision: 1.30
done
Checking in nbexec.exe;
/shared/data/ccvs/repository/core/launcher/windows/nbexec.exe,v  <--  nbexec.exe
new revision: 1.30; previous revision: 1.29
done
Comment 7 _ rkubacki 2007-07-16 12:53:35 UTC
*** Issue 102858 has been marked as a duplicate of this issue. ***