Added
Link Here
|
1 |
--- ganttproject.orig 2021-07-20 16:57:15 UTC |
2 |
+++ ganttproject |
3 |
@@ -31,17 +31,15 @@ fi |
4 |
# Parse the command line arguments. In this script we parse only those arguments which |
5 |
# are related to the Java VM launching. The remaining application-specific arguments |
6 |
# are passed as-is to the Java process. |
7 |
-PARSED_ARGS=$(getopt -o d::j:: --long debug:: --long java-home:: -- "$@") |
8 |
-eval set -- "$PARSED_ARGS" |
9 |
|
10 |
-USE_BUNDLED_RUNTIME=1 |
11 |
+USE_BUNDLED_RUNTIME=0 |
12 |
DEBUG_ARGS="" |
13 |
-while true; do |
14 |
- case "$1" in |
15 |
+while getopts "d:j:" opt; do |
16 |
+ case "$opt" in |
17 |
# Debug will switch on some debugging output and will allow for connecting to Java |
18 |
# process with a debugger |
19 |
- -d|--debug) |
20 |
- case "$2" in |
21 |
+ d) |
22 |
+ case "$OPTARG" in |
23 |
"") |
24 |
DEBUG_ARGS="-agentlib:jdwp=transport=dt_socket,server=y,address=8000,suspend=n" |
25 |
shift 2 |
26 |
@@ -53,11 +51,10 @@ while true; do |
27 |
esac |
28 |
;; |
29 |
# This allows for specifying the path to Java Runtime instead of the default bundled Java Runtime |
30 |
- -j|--java-home) |
31 |
+ j) |
32 |
USE_BUNDLED_RUNTIME=0 |
33 |
- case "$2" in |
34 |
+ case "$OPTARG" in |
35 |
"") |
36 |
- shift 2 |
37 |
;; |
38 |
*) |
39 |
JAVA_HOME="$2" |
40 |
@@ -65,7 +62,7 @@ while true; do |
41 |
;; |
42 |
esac |
43 |
;; |
44 |
- --) |
45 |
+ -) |
46 |
shift |
47 |
break |
48 |
;; |
49 |
@@ -128,12 +125,30 @@ check_java() { |
50 |
|
51 |
VERSION="$( $JAVA_COMMAND -version 2>&1 | grep version | head -n 1)" |
52 |
log "...found $VERSION" |
53 |
- [[ "$VERSION" =~ "11." ]] && return 0; |
54 |
- [[ "$VERSION" =~ "12." ]] && return 0; |
55 |
- [[ "$VERSION" =~ "13." ]] && return 0; |
56 |
- [[ "$VERSION" =~ "14." ]] && return 0; |
57 |
- [[ "$VERSION" =~ "15." ]] && return 0; |
58 |
- [[ "$VERSION" =~ "16." ]] && return 0; |
59 |
+ echo $VERSION | grep "11." |
60 |
+ if [ "0" == "$?" ]; then |
61 |
+ return 0 |
62 |
+ fi |
63 |
+ echo $VERSION | grep "12." |
64 |
+ if [ "0" == "$?" ]; then |
65 |
+ return 0 |
66 |
+ fi |
67 |
+ echo $VERSION | grep "13." |
68 |
+ if [ "0" == "$?" ]; then |
69 |
+ return 0 |
70 |
+ fi |
71 |
+ echo $VERSION | grep "14." |
72 |
+ if [ "0" == "$?" ]; then |
73 |
+ return 0 |
74 |
+ fi |
75 |
+ echo $VERSION | grep "15." |
76 |
+ if [ "0" == "$?" ]; then |
77 |
+ return 0 |
78 |
+ fi |
79 |
+ echo $VERSION | grep "16." |
80 |
+ if [ "0" == "$?" ]; then |
81 |
+ return 0 |
82 |
+ fi |
83 |
log "...this seems to be an old Java Runtime"; |
84 |
JAVA_COMMAND="" |
85 |
return 1 |
86 |
@@ -166,7 +181,7 @@ find_java() { |
87 |
report_java_not_found() { |
88 |
log "JavaVM executable not found. |
89 |
You may want to set the path to the root of your Java Runtime installation |
90 |
- in JAVA_HOME environment variable or pass it to ganttproject in --java-home argument"; |
91 |
+ in JAVA_HOME environment variable or pass it to ganttproject in -j argument"; |
92 |
if [ -z "$LOG_TEXT" ]; then |
93 |
LOG_TEXT="$(cat /tmp/ganttproject-launcher.log)" |
94 |
fi |
95 |
@@ -191,7 +206,7 @@ export CLASSPATH |
96 |
ECLIPSITO_ARGS="--verbosity 1 --version-dirs $GP_HOME/plugins:~/.ganttproject.d/updates --app net.sourceforge.ganttproject.GanttProject" |
97 |
BOOT_CLASS=com.bardsoftware.eclipsito.Launch |
98 |
|
99 |
-JAVA_ARGS="-Xmx1024m -Duser.dir=$(pwd) $DEBUG_ARGS $BOOT_CLASS $ECLIPSITO_ARGS -log true -log_file $LOG_FILE" |
100 |
+JAVA_ARGS="--module-path=/usr/local/openjfx14/lib --add-modules=javafx.swing,javafx.web -Xmx1024m -Duser.dir=$(pwd) $DEBUG_ARGS $BOOT_CLASS $ECLIPSITO_ARGS -log true -log_file $LOG_FILE" |
101 |
if [ -n "$(echo \"$*\" | sed -n '/\(^\|\s\)-/{p;}')" ]; then |
102 |
"$JAVA_COMMAND" $JAVA_ARGS "$@" |
103 |
else |