Bug 262542 - [launching] Installed 1.6 JRE not used for JavaSE-1.6 Execution Environment
Summary: [launching] Installed 1.6 JRE not used for JavaSE-1.6 Execution Environment
Status: RESOLVED WONTFIX
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Debug (show other bugs)
Version: 3.5   Edit
Hardware: PC Mac OS X - Carbon (unsup.)
: P3 normal (vote)
Target Milestone: 4.14 M3   Edit
Assignee: Sarika Sinha CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords: readme
: 260568 332308 (view as bug list)
Depends on:
Blocks:
 
Reported: 2009-01-27 08:51 EST by Markus Keller CLA
Modified: 2019-11-04 23:19 EST (History)
9 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Markus Keller CLA 2009-01-27 08:51:49 EST
I20090127-0100, Mac OS X carbon

On the Installed JREs preference page, I have a 1.6 and a 1.6.0 JRE installed (auto-detected via Search... button). But on the Execution Environments page, no compatible JRE is listed for JavaSE-1.6.
Comment 1 Markus Keller CLA 2009-01-27 08:53:13 EST
Log entries:

!ENTRY org.eclipse.jdt.launching 4 4 2009-01-27 14:44:26.722
!MESSAGE Failed to retrieve default libraries for /System/Library/Frameworks/JavaVM.framework/Versions/1.6/Home

!ENTRY org.eclipse.jdt.launching 4 4 2009-01-27 14:44:27.030
!MESSAGE Failed to retrieve default libraries for /System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Home

!ENTRY org.eclipse.jdt.launching 4 4 2009-01-27 14:44:32.741
!MESSAGE Unable to retrieve system properties
!STACK 1
org.eclipse.core.runtime.CoreException: Unable to retrieve system properties
	at org.eclipse.jdt.launching.AbstractVMInstall.abort(AbstractVMInstall.java:490)
	at org.eclipse.jdt.launching.AbstractVMInstall.evaluateSystemProperties(AbstractVMInstall.java:440)
	at org.eclipse.jdt.internal.launching.environments.ExecutionEnvironmentAnalyzer.isFoundation1_0(ExecutionEnvironmentAnalyzer.java:142)
	at org.eclipse.jdt.internal.launching.environments.ExecutionEnvironmentAnalyzer.analyze(ExecutionEnvironmentAnalyzer.java:89)
	at org.eclipse.jdt.internal.launching.environments.Analyzer.analyze(Analyzer.java:40)
	at org.eclipse.jdt.internal.launching.environments.EnvironmentsManager.analyze(EnvironmentsManager.java:334)
	at org.eclipse.jdt.internal.launching.environments.EnvironmentsManager.vmAdded(EnvironmentsManager.java:373)
	at org.eclipse.jdt.launching.JavaRuntime.fireVMAdded(JavaRuntime.java:2292)
	at org.eclipse.jdt.launching.VMStandin.convertToRealVM(VMStandin.java:152)
	at org.eclipse.jdt.internal.launching.LaunchingPlugin.processVMPrefsChanged(LaunchingPlugin.java:648)
	at org.eclipse.jdt.internal.launching.LaunchingPlugin.propertyChange(LaunchingPlugin.java:578)
	at org.eclipse.core.runtime.Preferences$1.run(Preferences.java:509)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
	at org.eclipse.core.runtime.Preferences.firePropertyChangeEvent(Preferences.java:512)
	at org.eclipse.core.internal.preferences.legacy.PreferenceForwarder.setValue(PreferenceForwarder.java:670)
	at org.eclipse.jdt.internal.debug.ui.jres.JREsUpdater$1.run(JREsUpdater.java:86)
	at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:121)
!SUBENTRY 1 org.eclipse.jdt.launching 4 150 2009-01-27 14:44:32.746
!MESSAGE Unable to retrieve system properties
Comment 2 Markus Keller CLA 2009-01-27 09:16:08 EST
I have a Mac mini with a 32-bit Intel Core Duo processor, but Apple's JavaSE 1.6 only runs on 64-bit machines:

$ cd /System/Library/Frameworks/JavaVM.framework/Versions/1.6/Commands/
$ ./java -version
-bash: ./java: Bad CPU type in executable


I think the Search... button should not add a JRE if it could not be launched. 

It would also be nice if the Installed JREs page could show a warning for JREs that don't work.
Comment 3 Markus Keller CLA 2009-01-27 09:25:23 EST
> I think the Search... button should not add a JRE if it could not be launched. 

Not adding the JRE would also mean that I could not compile against 1.6, even though the Eclipse compiler would work fine.

Better solution would be to infer the compiler compliance level from the folder name and also allow the JRE to be used as Execution Environment.
Comment 4 Darin Wright CLA 2009-01-27 09:58:33 EST
I think it would be good to show which VM's could not be analyzed/categorized for an EE, but I don't think we should infer what EE is compatible. I think the user needs to tell us if we can't figure it out. There's no guarentee that VM/directory names map to anything useful.
Comment 5 Markus Keller CLA 2009-01-27 10:31:11 EST
> [..] but I don't think we should infer what EE is compatible. I think the
> user needs to tell us if we can't figure it out. There's no guarentee that
> VM/directory names map to anything useful.

I agree that you should not infer what EE is strictly compatible, but it should be possible for me to select a (not-running) 1.6 JRE for the JavaSE-1.6 EE.
Comment 6 Darin Wright CLA 2009-01-29 09:21:22 EST
Note that when a VM is not executable, you can use an ee description file to contribute/configure a JRE:

http://wiki.eclipse.org/Execution_Environment_Descriptions

Perhaps there is really a bug with JRE detection on the Mac - we are just searching all directories in a known location, and assume the VMs will execute. I'm not sure if there's a convenient way we can tell which architecture a VM supports.
Comment 7 Markus Keller CLA 2009-05-01 09:46:49 EDT
*** Bug 260568 has been marked as a duplicate of this bug. ***
Comment 8 Michael Rennie CLA 2009-05-01 10:14:10 EDT
(In reply to comment #6)
> Perhaps there is really a bug with JRE detection on the Mac - we are just
> searching all directories in a known location, and assume the VMs will execute.
> I'm not sure if there's a convenient way we can tell which architecture a VM
> supports.
> 

we could look at the suggestion from bug 268153 comment 7 and try to determine if the VM will execute based on the platform arch compared to what the  sun.arch.data.model property returns. If nothing else this could give us a hint about the compatibility of the VM: i.e. if it will launch or not.

Comment 9 Darin Wright CLA 2009-06-08 10:41:36 EDT
Workaround: to get Eclipse to ignore the 1.6 VMs (which are not executable), one can remove them from the list of installed JREs ("Preferences > Java > Installed JREs").
Comment 10 Michael Rennie CLA 2010-12-10 09:38:51 EST
*** Bug 332308 has been marked as a duplicate of this bug. ***
Comment 11 Eclipse Genie CLA 2019-10-30 02:39:45 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.
Comment 12 Sarika Sinha CLA 2019-11-04 23:19:04 EST
Not much applicable now.