bndtools / bnd

Bnd/Bndtools. Tooling to build OSGi bundles including Eclipse, Maven, and Gradle plugins.
https://bndtools.org
Other
527 stars 305 forks source link

Windows: Space in user name fails launch #3763

Closed pkriens closed 4 years ago

pkriens commented 4 years ago

On windows, a home directory that has a space in the path will screw up the launch. It will try to use part of the path as the main class name.

gamerson commented 4 years ago

I'm debugging this issue now as I have a space in my Bnd workspace so I'm getting the following in my "launcher properties"..

fVMArgs String[8]  (id=2044)    
    [0] "-Dlauncher.properties=/Users/greg/my" (id=2053)    
    [1] "repos/service-upgrade-bot/lugbot/com.liferay.code.upgrade.providers.tests/generated/launch5231984034732314422.properties" (id=2054)    
    [2] "-ea" (id=2057) 
    [3] "-Dlauncher.runpath=/Users/greg/my" (id=2060)   
    [4] "repos/service-upgrade-bot/lugbot/cnf/cache/p2-Eclipse" (id=2061)   
    [5] "Platform" (id=2062)    
    [6] "R-4.14-201912100610/org.eclipse.osgi-3.15.100.v20191114-1701.jar,/Users/greg/my" (id=2063) 
    [7] "repos/service-upgrade-bot/lugbot/cnf/cache/5.1.0/bnd-cache/biz.aQute.launcher/biz.aQute.launcher-5.1.0.jar" (id=2066)  

You can see the VMArgs are splitting on the spaces in my launcher properties path.

gamerson commented 4 years ago

It seems this behavior change was introduced with this commit

3db9616c2ab3ee487b1b821dbb2a9932031c831a

It appears @bjhargrave intended to make this change, and according to his git commit, there is another place we need to "encode" these property values with quotes.

pkriens commented 4 years ago

Good find. Quotes are absolutely necessary there. Let's see what BJ says.

bjhargrave commented 4 years ago

Per @gamerson, the issue is only in Eclipse launching. Launching via gradle, maven, cli is ok. I understand the issue now with Eclipse launching and I have a fix I am locally testing. PR shortly.