Bug 211612 - Automatic JDK/JRE (re-)discovery
Summary: Automatic JDK/JRE (re-)discovery
Status: ASSIGNED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Debug (show other bugs)
Version: 3.3.1   Edit
Hardware: PC Windows XP
: P3 enhancement with 2 votes (vote)
Target Milestone: ---   Edit
Assignee: JDT-Debug-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-11-30 12:23 EST by Sven Köhler CLA
Modified: 2011-04-22 13:38 EDT (History)
5 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sven Köhler CLA 2007-11-30 12:23:16 EST
Build ID: M20071023-1652

I upgrade my JDKs regularly. Upon every upgrade, i have to reconfigure the "Installed JREs". An example:
- JDK 1.5.0_12 is in the list
- Exit Eclipse
- Uninstall 1.5.0_12, Install 1.5.0_13
- Start Eclipse
- JDK 1.5.0_12 is not in the list anymore, but 1.5.0_13 isn't either.

So i have to hit the search button again. I enter the parent directory ("c:\program files\java" on windows, "/opt/" on linux) and then Eclipse searched the whole directory tree.

RFE1: Actually, i would like to be able to limit the search to DIRECT children of the entered directory only. (Searching the whole tree simply takes to long on my linux and it's not worth the effort)


So the next step could be, to redicover installed JDKs. So if a JDK that was install in /path/to/jdk_version has been detected to be missing, the DIRECT children of parent directory (which is /path/to in the example) can be searched for installed JDKs/JREs.
This really makes sense assuming, that the new JDK is installed in the same parent directory, than the old version.
(An example from practice: old JDK was installed in c:\program files\java\jdk1.5.0_12, new one is installed in c:\program files\java\jdk1.5.0_13 => same parent directory c:\program files\java )


To avoid, that this detection takes place at every start, it should really only be triggered on certain events like the initial start of eclipse, detection of an uninstalled JDK, ...
Comment 1 Jerome Lanneluc CLA 2007-11-30 12:26:37 EST
Moving to JDT/Debug
Comment 2 Sven Köhler CLA 2007-11-30 12:28:49 EST
Oh, on the contrary, users may actually want to disable certain JDKs. But an automatic detection will cause JDK to redisappear over and over.
So the "Installed JREs" dialog should be extended to offer a possibility to disable JDKs without removing them from the list. (for example adding another column of checkboxes for disabling)
Comment 3 Sven Köhler CLA 2007-11-30 13:30:21 EST
Sorry for switching JDT/debug back to JDT/Core. Didn't mean it.

In comment #2, i wanted to say "reappear" instead of "redisappear".
Comment 4 Darin Wright CLA 2008-04-28 17:33:20 EDT
Feature freeze is upon us, marking assigned for future consideration.
Comment 5 Sven Köhler CLA 2010-01-23 07:45:10 EST
Any progress?
Comment 6 Darin Wright CLA 2010-01-23 13:47:48 EST
(In reply to comment #5)
> Any progress?

Sorry, none. Contributions are welcome, noting the IP approval contribution deadline of Feb 5, 2010, for inclusion in 3.6.
Comment 7 Heiko Böttger CLA 2011-04-07 04:05:37 EDT
Same problem still exists on Windows 7. Everytime my JRE is updated, directory is changed from the JDT to the JRE directory. This is not a problem for using eclipse as long you don't need to do thing requiring the jdk such as signing jars. Since all normally all jdks are installed in the same subdirectory, why eclipse cannot detect the latest jdk by itself.
Comment 8 Michael Rennie CLA 2011-04-07 10:00:41 EDT
(In reply to comment #7)
> Same problem still exists on Windows 7. Everytime my JRE is updated, directory
> is changed from the JDT to the JRE directory. This is not a problem for using
> eclipse as long you don't need to do thing requiring the jdk such as signing
> jars. Since all normally all jdks are installed in the same subdirectory, why
> eclipse cannot detect the latest jdk by itself.

Heiko, have you had a chance to try a more recent version of Eclipse that contains the fix for bug 266651? Perhaps that also resolves this update issue as well.
Comment 9 Heiko Böttger CLA 2011-04-07 15:45:57 EDT
(In reply to comment #8)
> (In reply to comment #7)
> > Same problem still exists on Windows 7. Everytime my JRE is updated, directory
> > is changed from the JDT to the JRE directory. This is not a problem for using
> > eclipse as long you don't need to do thing requiring the jdk such as signing
> > jars. Since all normally all jdks are installed in the same subdirectory, why
> > eclipse cannot detect the latest jdk by itself.
> 
> Heiko, have you had a chance to try a more recent version of Eclipse that
> contains the fix for bug 266651? Perhaps that also resolves this update issue
> as well.

Thanks Michael, I will give it a try and download the 3.7 integration build.
Comment 10 Jan Peter Stotz CLA 2011-04-22 13:38:34 EDT
(In reply to comment #7)
> Since all normally all jdks are installed in the same subdirectory, why
> eclipse cannot detect the latest jdk by itself.

It could even simpler on Windows. I assume that 99.9% use Java from Sun/Oracle and their JDK registers itself in the registry under

HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Development Kit

and the JRE under
HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Runtime Environment

AFAIR SWT contains methods for reading the registry (org.eclipse.swt.internal.win32.*) and therefore it would be feasible to detect all installed JDKs and JREs in milliseconds even if they has been installed into non-standard directories.