Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 385326

Summary: Execution environment has no linkage to the installed JRE (x86_64, SLED 11, Eclipse 3.7.2)
Product: [Eclipse Project] JDT Reporter: John P. Petrakis <jpetrakis>
Component: DebugAssignee: JDT-Debug-Inbox <jdt-debug-inbox>
Status: CLOSED NOT_ECLIPSE QA Contact:
Severity: major    
Priority: P3 CC: curtis.windatt.public, Michael_Rennie, Olivier_Thomann
Version: 3.7.2   
Target Milestone: ---   
Hardware: Other   
OS: Linux   
Whiteboard:
Attachments:
Description Flags
full stack traces of problem. none

Description John P. Petrakis CLA 2012-07-17 11:44:26 EDT
Build Identifier: M20120208-0800

I'm using a SLED 11 x86-64 VM with IBM JDK 7.0 Rev 1 and Eclipse 3.7.2 SDK.  I symlink the jre folder in the eclipse folder prior to running Eclipse to ensure which JRE I am using.  The work bench starts without any obvious problems... ps -ef confirms which JRE is running.  However when I open up the "installed JRE" preference I get several IO erros and although the installed JRE shows in the panel, if I open up the execution environments and select any, NO jre shows up on the right hand pane (for matching JRE's).  Attempting to create a new java project defaults to "OSGI 1.2" for the execution environment when it should be selecting something else...

The exceptions are generally in the form of some IO Exceptions:

!ENTRY org.eclipse.debug.core 4 125 2012-07-17 11:09:49.144
!MESSAGE Error logged from Debug Core: 
!STACK 0
java.io.IOException: Interrupted system call....

!ENTRY org.eclipse.jdt.launching 4 4 2012-07-17 11:09:49.252
!MESSAGE Failed to retrieve default libraries for /opt/local/ibm-java-x86_64-70

!ENTRY org.eclipse.jdt.launching 4 4 2012-07-17 11:10:03.992
!MESSAGE Terminate failed
!STACK 1
org.eclipse.debug.core.DebugException: Terminate failed
	at org.eclipse.debug.core.Launch.terminate(Launch.java:263)...

(see attachement for full traces)




Reproducible: Always

Steps to Reproduce:
1. Obtain and unpack the IBM JDK 7.0 Rev 1
2. Obtain and unpack Eclipse 3.7.2 SDK
3. symlink the jre in the IBM Jdk location to the eclipse folder
4) start eclipse
5) open the "installed jre" preferences"... first exceptions occur
6) close the prefs, and create a new java project you get terminate failed exc.

The new project will not build unless you choose either of the radio buttons that indicate a specific jdk to use as opposed to the exec. env. radio button.
Comment 1 John P. Petrakis CLA 2012-07-17 11:46:54 EDT
Created attachment 218812 [details]
full stack traces of problem.
Comment 2 Olivier Thomann CLA 2012-07-17 11:47:29 EDT
Moving to JDT/Debug
Comment 3 John P. Petrakis CLA 2012-07-17 11:48:25 EDT
oh yes... this does NOT occur on the exact same system for 

1) 32 bit java and eclipse (IBM jdk)
2) if you switch the 64 bit IBM jdk for the Oracle java 7 jdk
Comment 4 Olivier Thomann CLA 2012-07-17 11:49:15 EDT
Could you please try with the Juno release ?
Comment 5 John P. Petrakis CLA 2012-07-17 11:51:23 EDT
that second item should have read:

2) if you switch from the IBM Java 7 JDK to the Oracle Java 7 JDK
Comment 6 John P. Petrakis CLA 2012-07-17 11:51:48 EDT
Juno.. 3.8 or 4.2?
Comment 7 John P. Petrakis CLA 2012-07-17 11:52:37 EDT
Juno.. 3.8 or 4.2?
Comment 8 Olivier Thomann CLA 2012-07-17 11:55:11 EDT
(In reply to comment #7)
> Juno.. 3.8 or 4.2?
For jdt/debug I don't think it is changing anything. Most bundles are the same between 3.8 and 4.2. 4.2 impacts mostly UI bundles.
Comment 9 Olivier Thomann CLA 2012-07-17 11:55:48 EDT
(In reply to comment #5)
> 2) if you switch from the IBM Java 7 JDK to the Oracle Java 7 JDK
I guess you mean Oracle Java 7 64 bits JDK ?
Comment 10 Michael Rennie CLA 2012-07-17 12:26:28 EDT
(In reply to comment #0)
> Reproducible: Always

> 3. symlink the jre in the IBM Jdk location to the eclipse folder

Can you add the JDK to the preferences if you do not symlink it? The "Failed to retrieve default libraries for /opt/local/ibm-java-x86_64-70" exception shown occurs when we try to run the VM to ask it for its default libraries and it fails. 

I am wondering if there is some sort of permissions issue here. Also the IOExceptions about the system call being interrupted are probably the reason we are failing to collect the VM libs. Do you happen to have a plugin / shell script or something that is sending signals to the Java process that could interrupt the IO?

> 4) start eclipse
> 5) open the "installed jre" preferences"... first exceptions occur
> 6) close the prefs, and create a new java project you get terminate failed exc.
> 
> The new project will not build unless you choose either of the radio buttons
> that indicate a specific jdk to use as opposed to the exec. env. radio button.

This is expected - sort of, but handled very poorly - if we can't launch the VM (or collect its libraries) and you set it to be used, each time the VM is asked a question you get a pile of exceptions.
Comment 11 John P. Petrakis CLA 2012-07-17 12:40:32 EDT
Yes by Oracle JDK I mean the oracle 64 bit java 7 jdk
Comment 12 John P. Petrakis CLA 2012-07-17 12:44:10 EDT
RE: Permissions.  That had occurred to me as well but the folders I have (/opt/local/*) are owned by "me" and the mode on "/opt/local" is 777.  The JDK, eclipse and workspace root are all located under /opt/local.  I'm cd'ing straight into the eclipse folder (which I own) and running eclipse directly.... no other scripts are being used at the moment.
Comment 13 Olivier Thomann CLA 2012-07-17 12:58:57 EDT
(In reply to comment #11)
> Yes by Oracle JDK I mean the oracle 64 bit java 7 jdk
Are you also using a symlink to connect to Oracle JDK?
Comment 14 John P. Petrakis CLA 2012-07-17 13:03:14 EDT
yes  I simply removed and recreated the symlink ...
Comment 15 John P. Petrakis CLA 2012-07-17 13:05:23 EDT
It seems eclipse 3.8 has the same issue.
Comment 16 John P. Petrakis CLA 2012-07-17 13:06:28 EDT
FIFW: I've used the same set-up technique (with the same UID) on RHEL 5.6, and 6.2 x86-64 systems without incident....
Comment 17 John P. Petrakis CLA 2012-07-17 13:08:02 EDT
I can add other JDKs to the installed JRE list but none seem to end up showing up in the exec environment page of the prefs (eg. 64 bit IBM java 6 )
Comment 18 John P. Petrakis CLA 2012-07-17 13:23:20 EDT
Here is something else:

1) using Eclipse 3.8 and IBM x86_64 jdk, open up a new workspace (symlinked jre in eclipse dir)
2) open prefs to installed JRE and same exceptions occur
3) remove symlink and replace with a new symlinke pointing at the Oracle x86_64 Jdk
4) restart and use same workspace
5) installed jre still shows as IBM Jdk 7 but this time, no exceptions AND the execution environment only shows the IBM Jdk 7.

it does not show the oracle jdk as being installed.

starting eclipse 3.8 with a FRESH workspace and the oracle jdk symlinked, the installed jre shows the oracle jre and the execution environment shows the proper linkage to the jre specified by the symlink.  

If I ADD the IBM JDK (eg. 7.0 Rev 1) at this point, the ibm jdk now shows as installed but it does NOT show up in the exec. environment sheet when selectiong the Java SE 1.7 environment (or earlier).  Only the oracle one does.
Comment 19 Olivier Thomann CLA 2012-07-17 13:30:59 EDT
This really belongs to JDT/Debug
Comment 20 Michael Rennie CLA 2012-07-23 10:44:24 EDT
(In reply to comment #18)
> Here is something else:
> 
> 1) using Eclipse 3.8 and IBM x86_64 jdk, open up a new workspace (symlinked jre
> in eclipse dir)
> 2) open prefs to installed JRE and same exceptions occur
> 3) remove symlink and replace with a new symlinke pointing at the Oracle x86_64
> Jdk
> 4) restart and use same workspace
> 5) installed jre still shows as IBM Jdk 7 but this time, no exceptions AND the
> execution environment only shows the IBM Jdk 7.

This is working as expected. We cache valid JRE locations to speed up their re-resolution when Eclipse loads - we added some limited support for detecting library changes on-disk outside of Eclipse but we do not try to rename the JRE in your preferences.

> it does not show the oracle jdk as being installed.
> 
> starting eclipse 3.8 with a FRESH workspace and the oracle jdk symlinked, the
> installed jre shows the oracle jre and the execution environment shows the
> proper linkage to the jre specified by the symlink.  

Can you add the IBM jdk to the preferences if you DO NOT symlink it?
Comment 21 John P. Petrakis CLA 2012-07-24 08:49:19 EDT
It so happens that the JVM that is running the platform cannot be added.  I did try this without using the symlink (used the "-vm" command line switch) and it did not make a difference.  I had the java 6 and 7 VMs available (happened to be running under java 6).  The java 6 could not install or even be searches and recognized but the java 7 one could.  Even when it DOES install, the execution environment still won't recognize it.
Comment 22 John P. Petrakis CLA 2012-07-24 11:34:51 EDT
I should clarify a bit perhaps.  If the running eclipse platform has no visible "installed jre" in the preference page, attempting to add the jre that was used to launch the running workbench will fail... regardless of what you do to add it.  If you point to some other jre it will add it to the installed jre list but it won't show up as a vm choice in the exec. environment page.
Comment 23 John P. Petrakis CLA 2012-07-31 09:15:56 EDT
Is there any chance this could be a problem with the 64 bit IBM jvms?  The 32 bit eclipse/jvm combinations appear to work just fine on the same SLED 11 vm platform.
Comment 24 Curtis Windatt CLA 2012-11-06 11:14:14 EST
I only have a 32 bit Ubuntu 11.04 machine to test on, but this works correctly for both IBM and Oracle 7 VMs (32 bit).
Comment 25 John P. Petrakis CLA 2012-11-06 13:00:16 EST
Yes that's right.  On this 64 bit system, the 32 bit eclipse and jvm's function as expected and this doesn't appear to occur.  It seems as if it's the 64 bit vms and eclipse that suffer this effect and mostly the IBM one at that.
Comment 26 John P. Petrakis CLA 2012-11-08 11:12:55 EST
This, when it does happen, seems to be a fairly uncommon problem.  As this hasn't occured for us for some time (and we suspect the problem may really be in the JVM) I think this can be closed so I'm doing exactly that.