Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 340672 - Start Debug throws ArrayIndexOutOfBoundsException when JDK_HOME is a drive letter
Summary: Start Debug throws ArrayIndexOutOfBoundsException when JDK_HOME is a drive le...
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Debug (show other bugs)
Version: 3.7   Edit
Hardware: PC Windows All
: P3 normal (vote)
Target Milestone: 3.7 M7   Edit
Assignee: Michael Rennie CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 286537 (view as bug list)
Depends on:
Blocks:
 
Reported: 2011-03-22 11:32 EDT by smartiro CLA
Modified: 2012-04-10 13:14 EDT (History)
2 users (show)

See Also:
curtis.windatt.public: review+


Attachments
fix (1.58 KB, patch)
2011-03-23 11:56 EDT, Michael Rennie CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description smartiro CLA 2011-03-22 11:32:09 EDT
Build Identifier: 20110218-0911

I have JDK_HOME set to j:
When trying to start debug session on any of my programs I get:

java.lang.ArrayIndexOutOfBoundsException: -1
at org.eclipse.core.runtime.Path.segment(Path.java:855)
at org.eclipse.jdt.internal.launching.StandardVMDebugger.prependJREPath(StandardVMDebugger.java:374)
at org.eclipse.jdt.internal.launching.StandardVMDebugger.run(StandardVMDebugger.java:221)
at org.eclipse.jdt.launching.JavaLaunchDelegate.launch(JavaLaunchDelegate.java:101)
at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:853)
at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:702)
at org.eclipse.debug.internal.ui.DebugUIPlugin.buildAndLaunch(DebugUIPlugin.java:924)
at org.eclipse.debug.internal.ui.DebugUIPlugin$7.run(DebugUIPlugin.java:1010)
at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:121)

This works fine when I set java to point to c:\java1.6_20 instead of j:
so that line: 
    jrepath.segment(jrepath.segmentCount()-2).equals(JRE)

in StandardVMDebugger.java does not throw

Reproducible: Always

Steps to Reproduce:
1. subst J: C:\jdk1.6.0_20 
2. set path to use j: instead of C:\jdk1.6.0_20
3. point eclipse to JDK of j:
4. Run any debug session.
Comment 1 Michael Rennie CLA 2011-03-23 11:56:56 EDT
Created attachment 191766 [details]
fix

Easily reproduced using the given steps. The patch prevents the AIOOBE.
Comment 2 Michael Rennie CLA 2011-03-23 11:59:38 EDT
applied patch to HEAD, Curtis could you verify the fix on WinXP?
Comment 3 Curtis Windatt CLA 2011-03-25 16:18:02 EDT
Verified
Comment 4 Michael Rennie CLA 2012-04-10 13:14:45 EDT
*** Bug 286537 has been marked as a duplicate of this bug. ***