X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=utils%2Fjdeps_jlink_all.sh;fp=utils%2Fjdeps_jlink_all.sh;h=394e8b5faef54b0d2122d8bb5ae9325d67dd4b74;hb=4d64932654de3f6ffe07db11d18f2d21f558c6e6;hp=0000000000000000000000000000000000000000;hpb=382f5ff058a4c2fed1e9874bb712b40f16ec1a4e;p=jalview.git diff --git a/utils/jdeps_jlink_all.sh b/utils/jdeps_jlink_all.sh new file mode 100755 index 0000000..394e8b5 --- /dev/null +++ b/utils/jdeps_jlink_all.sh @@ -0,0 +1,23 @@ +#/usr/bin/env bash + +# be in the jalview top level dir. +# lib -- contains usual jalview jar files +# j11lib -- contains extra jar files needed in classpath for Java 11 +# j11mod -- contains java11 style modules to be put into the JRE (not needed at runtime) +# +# j11jre -- dir containing JRE environments for jalview +# +# creates file modules.new which is comma-separated list of modules needed, can be used like this in jlink argument +# and a java 11 JRE in j11jre/jre-new + +( for x in lib/*.jar j11lib/*.jar j11mod/*.jar dist/jalview.jar; do echo $x >&2; jdeps --list-deps --module-path j11mod $x | grep -v Warning: | grep -v "JDK removed" | sed -e 's/^ *//;s/\/.*//;s/$/,/;'; done ) | sort -u | perl -p -e 'chomp;' | sed -e 's/,$//;' > modules.new + +if [ x$JAVA_HOME != x ]; then + jlink --no-header-files --no-man-pages --strip-debug --module-path "$JAVA_HOME/jmods:j11mod" --add-modules `cat modules.new` --compress=2 --output j11jre/jre-new +else + jlink --no-header-files --no-man-pages --strip-debug --module-path "j11mod" --add-modules `cat modules.new` --compress=2 --output j11jre/jre-new +fi + + +# or if you're in a hurry for a one-liner... +#jlink --no-header-files --no-man-pages --strip-debug --module-path "$JAVA_HOME/jmods:j11mod" --add-modules ` ( for x in lib/*.jar j11lib/*.jar j11mod/*.jar dist/jalview.jar; do echo $x >&2; jdeps --list-deps --module-path j11mod $x | grep -v "Warning:" | grep -v "JDK removed" | sed -e 's/^ *//;s/\/.*//;s/$/,/;'; done ) | sort -u | perl -p -e 'chomp;' | sed -e 's/,$//;' ` --compress=2 --output j11jre/jre-new