You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The text was updated successfully, but these errors were encountered:
hiteclab
changed the title
Export application with embed java fails in Linux when the path have any folder name with space character
Exported application with embed java fails in Linux when the path have any folder name with space character
Nov 3, 2020
1.Check for Quoting and Escaping
2.Modify the Application:
If you have control over the application code, you can modify it to handle spaces in paths correctly. Use the (java.nio.file) package to manipulate file paths in a cross-platform way, ensuring spaces are handled correctly.
3.Use Quoted Paths in Shell Scripts:
#!/bin/bash
java -jar "/path/to/your application.jar"
I analyze it and try to solve it try to implement this step may it will help and please let me know.
Description
Exported application with embed java fails in Linux when the path have any folder name with space character
The wrong script generated looks like this:
#!/bin/sh
APPDIR=$(readlink -f "$0")
APPDIR=$(dirname "$APPDIR")
$APPDIR/java/bin/java -Djna.nosys=true -Djava.ext.dirs="$APPDIR/java/lib/ext" -Djava.library.path="$APPDIR:$APPDIR/lib" -cp "$APPDIR:$APPDIR/lib/Alphamask.jar:$APPDIR/lib/core.jar:$APPDIR/lib/jogl-all.jar:$APPDIR/lib/gluegen-rt.jar:$APPDIR/lib/jogl-all-natives-linux-amd64.jar:$APPDIR/lib/gluegen-rt-natives-linux-amd64.jar" Alphamask "$@"
Expected Behavior
Current Behavior
Steps to Reproduce
Your Environment
Possible Causes / Solutions
To solve the problem just use "$APPDIR" instead $APPDIR at the begging of the line 5
#!/bin/sh
APPDIR=$(readlink -f "$0")
APPDIR=$(dirname "$APPDIR")
"$APPDIR"/java/bin/java -Djna.nosys=true -Djava.ext.dirs="$APPDIR/java/lib/ext" -Djava.library.path="$APPDIR:$APPDIR/lib" -cp "$APPDIR:$APPDIR/lib/Alphamask.jar:$APPDIR/lib/core.jar:$APPDIR/lib/jogl-all.jar:$APPDIR/lib/gluegen-rt.jar:$APPDIR/lib/jogl-all-natives-linux-amd64.jar:$APPDIR/lib/gluegen-rt-natives-linux-amd64.jar" Alphamask "$@"
The text was updated successfully, but these errors were encountered: