File: minJavaVerOpts

package info (click to toggle)
bitsnpicas 2.0%2Bds-3
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 11,140 kB
  • sloc: java: 64,122; sh: 457; makefile: 131; python: 90; javascript: 11
file content (15 lines) | stat: -rwxr-xr-x 362 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/usr/bin/env bash
echo -n 'Determining minimum version javac can compile... ' 1>&2
echo 'public class tmp {}' > tmp.java
for v in {5..100}; do
	if javac -source $v -target $v tmp.java > /dev/null 2>&1; then
		rm -f tmp.java tmp.class
		echo "$v" 1>&2
		echo "-source $v -target $v"
		exit 0
	fi
done
rm -f tmp.java tmp.class
echo 'Unknown' 1>&2
echo ''
exit 1