Bug 3106 - IBM JDK 1.3.0 SR 9a fails with space in path (1GIRH9B)
Summary: IBM JDK 1.3.0 SR 9a fails with space in path (1GIRH9B)
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Resources (show other bugs)
Version: 2.0   Edit
Hardware: All Windows 2000
: P3 normal (vote)
Target Milestone: 2.0 M3   Edit
Assignee: John Arthorne CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 8588 9894 10005 (view as bug list)
Depends on:
Blocks:
 
Reported: 2001-10-10 22:49 EDT by Jeff McAffer CLA
Modified: 2021-01-04 05:30 EST (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 Jeff McAffer CLA 2001-10-10 22:49:32 EDT
JW(8/20/2001 10:35:20 AM):
Using the latest IBM JDK (1.3.0 Service Release 9a cn130-20010609) from Hursley fails. You can't bring up the
workbench if there is a space somewhere in the path. For example, if Eclipse is in a directory
like  "c:\some path with a space\eclipse" it won't come up.

A little bit of debugging shows that in Main.getBootPath(String) this statement:

	url = getClass().getProtectionDomain().getCodeSource().getLocation()

Returns a url with the spaces turned into "%20". For example, the above path
would become:

"c:\some%20path%20with%20a%20space\eclipse"

It then can't find anything because "%20" is not treated as a space but as
characters in the path and it can't find that path.

The same thing happens in InternalBootLoader.getInstallURL().

A workaround for now is to use the option:

   -boot "c:\some path with a space\eclipse"

This then works and you can bring up Eclipse.


NOTES:
Comment 1 DJ Houghton CLA 2001-10-24 06:44:35 EDT
PRODUCT VERSION: R0.9 JDK


Comment 2 John Arthorne CLA 2002-01-28 09:51:28 EST
Users on EC also report this problem with IBM JDK cn130-20010925.  One user 
suggested a workaround (Martin Wronna):

Here is the problem.
In Java 1.4_RC1 must create a URI, not a URL.

URI uri = new URI(url.toString());

Then can the listFiles found the Files in Pathes with %20.

The problem is, the URI exists first in 1.4
If any use the program with an older JVM, than have he the problem, 
which in the moment 1.4 has.

As workaround, i think, following should run:

...
File[] boots = new File(start).listFiles(filter);

if (boots == null) {
        File[] boots = new File(new 
                java.net.URI(start.toString())).listFiles(filter);
}
Comment 3 DJ Houghton CLA 2002-01-28 11:55:41 EST
*** Bug 8588 has been marked as a duplicate of this bug. ***
Comment 4 John Wiegand CLA 2002-01-29 19:56:28 EST
With build 0129, I have verified that eclipse starts up on the following vms 
when eclipse is installed in a directory named "eclipsex 0129".
sun jdk 1.3.0_04
sun jdk 1.3.1_01
sun jdk 1.4 rc (b91)
ibm jdk 1.3 sr9 (cn130-20010609)
ibm jdk 1.3 sr10  (cn130-20010925)

In build 0125

sun jdk 1.3.0_04 -> WORKS
sun jdk 1.3.1_01 ->WORKS
sun jdk 1.4 rc (b91) -> DOES NOT WORK
ibm jdk 1.3 sr9 (cn130-20010609)-> DOES NOT WORK
ibm jdk 1.3 sr10  (cn130-20010925) -> DOES NOT WORK

Observation: Renaming an existing install tree will render the install invalid.
Comment 5 John Arthorne CLA 2002-02-05 14:46:20 EST
Fixed in build 20020129

Also tested in:

J9 (build 20011114)
Sun JDK 1.4.0-beta-b64

Comment 6 DJ Houghton CLA 2002-02-15 10:47:03 EST
*** Bug 9894 has been marked as a duplicate of this bug. ***
Comment 7 DJ Houghton CLA 2002-02-15 15:46:22 EST
Also fixed in Rollup2.
Comment 8 DJ Houghton CLA 2002-04-05 18:00:16 EST
*** Bug 10005 has been marked as a duplicate of this bug. ***
Comment 9 Jindong Li CLA 2002-07-23 15:57:18 EDT
A somehow related problem?

Our plugin uses RMI and is running with SUN's jdk131-b24...if installed under a 
path that's has space in it (for example c:\program files), we don't have any 
problem starting up eclipse...however, we do have problem loading up the jar 
files when making a RMI call...the following is a copy of the exception we get:

java.lang.Throwable: RemoteException occurred in server thread; nested 
exception is: 
	java.rmi.UnmarshalException: error unmarshalling arguments; nested 
exception is: 
	java.net.MalformedURLException: no protocol: 
jd/plugins/com.solcorp.ide.pathfinder_1.0.0/pide.jar
	at com.solcorp.ide.pathfinder.core.CorePlugin.logError
(CorePlugin.java:633)
	at com.solcorp.ide.pathfinder.debug.core.PFDebugElement.logError
(PFDebugElement.java:53)
	at com.solcorp.ide.pathfinder.debug.core.PFThread.registerCallBack
(PFThread.java:998)
	at com.solcorp.ide.pathfinder.debug.core.PFThread.initializeDebugger
(PFThread.java:932)
	at com.solcorp.ide.pathfinder.debug.core.PFThread.<init>
(PFThread.java:73)
	at com.solcorp.ide.pathfinder.debug.core.PFDebugTarget.createThread
(PFDebugTarget.java:256)
	at com.solcorp.ide.pathfinder.debug.core.PFLaunchConfiguration.launch
(PFLaunchConfiguration.java:161)
	at org.eclipse.debug.internal.core.LaunchConfiguration.launch
(LaunchConfiguration.java:136)
	at 
org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationDialog$10.
run(LaunchConfigurationDialog.java:2299)
	at org.eclipse.jface.operation.ModalContext$ModalContextThread.run
(ModalContext.java:98)

As you can see...path "reclipse jd" is truncated to "jd" only...

Now this is really a SUN JDK bug (please see 

http://developer.java.sun.com/developer/bugParade/bugs/4496398.html
http://developer.java.sun.com/developer/bugParade/bugs/4273532.html

for detail...

My question though, is there any workaround for this problem or we have to wait 
until SUN fixes it...?

Any comments would be greatly appreciated...

Jindong.
Comment 10 John Arthorne CLA 2002-07-25 09:56:21 EDT
I'm not an RMI user, so this is just a guess, but you could try encoding the 
spaces in the path as %20 to see if that is handled better.

If it's a bug in the JDK, you could always try a newer version or one from a 
different provider.  Perhaps JDK 1.4 or the IBM JDK won't have the same 
problem...
Comment 11 Jindong Li CLA 2002-07-25 10:11:04 EDT
The thing is, I'm not writting code to load the jars in my 
application...Eclipse / JVM does that for me automatically...:-(

Comment 12 Eclipse Genie CLA 2021-01-04 05:30:53 EST
New Gerrit change created: https://git.eclipse.org/r/c/orbit/orbit-recipes/+/174214