JonathanGiles / scenic-view

Scenic View is a JavaFX application designed to make it simple to understand the current state of your application scenegraph, and to also easily manipulate properties of the scenegraph without having to keep editing your code. This lets you find bugs, and get things pixel perfect without having to do the compile-check-compile dance.
GNU General Public License v3.0
523 stars 68 forks source link

Issue #50: Allow to launch ScenicView from within a path containing spaces #51

Closed afester closed 3 years ago

afester commented 5 years ago

Fix for #50 : Allow spaces in installation path. Test case: clone repository int a path containing spaces, then

> gradlew jlink
> cd build\scenicview\bin
> .\scenicView
Platform running
Launching ScenicView v11.0.2
Startup done
Creating server
Server done
Number of running Java applications found: 4
Obtaining properties for Java application with PID:800
Obtaining properties for Java application with PID:17492
Obtaining properties for Java application with PID:15308
0 JavaFX applications found
java.net.URISyntaxException: Illegal character in path at index 15: file:/D:/Scenic View/build/scenicview/lib/scenicview.jar
        at java.base/java.net.URI$Parser.fail(Unknown Source)
        at java.base/java.net.URI$Parser.checkChars(Unknown Source)
        at java.base/java.net.URI$Parser.parseHierarchical(Unknown Source)
        at java.base/java.net.URI$Parser.parse(Unknown Source)
        at java.base/java.net.URI.<init>(Unknown Source)
        at java.base/java.net.URL.toURI(Unknown Source)
        at org.scenicview.scenicview/org.fxconnector.remote.RemoteConnectorImpl.findAgent(Unknown Source)
        at org.scenicview.scenicview/org.fxconnector.remote.RemoteConnectorImpl.connect(Unknown Source)
        at org.scenicview.scenicview/org.scenicview.model.update.RemoteVMsUpdateStrategy.getActiveApps(Unknown Source)
        at org.scenicview.scenicview/org.scenicview.model.update.RemoteVMsUpdateStrategy.work(Unknown Source)
        at org.scenicview.scenicview/org.fxconnector.helper.WorkerThread.run(Unknown Source)
Error: Unable to find agent jar file. Exiting Scenic View.

After bugfix:

> .\scenicView
Platform running
Launching ScenicView v11.0.2
Startup done
Creating server
Server done
Number of running Java applications found: 4
Obtaining properties for Java application with PID:800
Obtaining properties for Java application with PID:17492
Obtaining properties for Java application with PID:15308
0 JavaFX applications found
Loading agent from: D:\Scenic View\build\scenicview\lib\scenicview.jar
ross-holloway94 commented 3 years ago

Looks like a good fix in my opinion @JonathanGiles :)