-
Notifications
You must be signed in to change notification settings - Fork 17
Expand file tree
/
Copy pathrun-java.sh
More file actions
executable file
·36 lines (30 loc) · 1.05 KB
/
Copy pathrun-java.sh
File metadata and controls
executable file
·36 lines (30 loc) · 1.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
if [ $# -eq 0 ]; then
echo "Please provide an example number:"
echo "./run-java.sh 33"
exit 1
fi
# Very important!!
./clean.sh
mkdir -p out/production
# --release 8 builds Java 8 class files, so the library and the example run on
# Java 8 and later whichever JDK builds them. Java 8's javac has no --release
# option and builds Java 8 class files anyway, so the option is left out there.
RELEASE="--release 8"
if ! javac --release 8 -version > /dev/null 2>&1; then
RELEASE=""
fi
# Compile the PDFjet library.
javac -O -encoding utf-8 $RELEASE -Xlint -Xlint:-options \
com/pdfjet/*.java \
com/pdfjet/barcodes/*.java \
com/pdfjet/pdf417/*.java \
com/pdfjet/qrcode/*.java \
com/pdfjet/datamatrix/*.java \
com/pdfjet/fonts/*.java \
com/pdfjet/encryption/*.java \
-d out/production
# Compile and run the Example_?? program.
javac -encoding utf-8 $RELEASE -Xlint -Xlint:-options -cp out/production examples/Example_$1.java -d out/production
java -cp out/production examples.Example_$1
mupdf Example_$1.pdf
# evince Example_$1.pdf