Author: Andreas Tille
Last-Update: 2015-10-06
Description: Use JAVA_HOME variable instead of calculating it (possibly wrongly)
Forwarded: not-needed

--- a/Makefile.common.mk
+++ b/Makefile.common.mk
@@ -87,7 +87,7 @@ JAVACTARGETOPTIONS=-target ${JAVAVERSION
 JAVACOPTIONS = -O ${JAVACTARGETOPTIONS} -encoding "UTF8" -Xlint:deprecation -XDignore.symbol.file -Xdiags:verbose
 
 .java.class:
-	export JAVAVERSIONTARGETJARFILE=`/usr/libexec/java_home -v ${JAVAVERSIONTARGET} | tail -1`/jre/lib/rt.jar; javac ${JAVACOPTIONS} \
+	export JAVAVERSIONTARGETJARFILE=${JAVA_HOME}/jre/lib/rt.jar; javac ${JAVACOPTIONS} \
 		-classpath ${PATHTOROOT}:${SLF4JCOMPILEADDITIONALJAR}:${DICOMADDITIONALJARS}:${VIEWERADDITIONALJARS}:${FTPADDITIONALJARS}:${JUNITJAR} \
 		-sourcepath ${PATHTOROOT} $<
 
--- a/com/pixelmed/apps/Makefile
+++ b/com/pixelmed/apps/Makefile
@@ -52,7 +52,7 @@ include ${PATHTOROOT}/Makefile.common.mk
 
 # override javac command in Makefile.common.mk to add codec to classpath, until folded into main trunk :(
 .java.class:
-	export JAVAVERSIONTARGETJARFILE=`/usr/libexec/java_home -v ${JAVAVERSIONTARGET} | tail -1`/jre/lib/rt.jar; javac ${JAVACOPTIONS} \
+	export JAVAVERSIONTARGETJARFILE=${JAVA_HOME}/jre/lib/rt.jar; javac ${JAVACOPTIONS} \
 		-classpath ${PATHTOROOT}:${SLF4JCOMPILEADDITIONALJAR}:${DATABASEADDITIONALJARS}:${FTPADDITIONALJARS}:${JPEGBLOCKREDACTIONJAR}:${PATHTOADDITIONAL}/javax.json-api-1.0.jar:${JIIOADDITIONALJARS} \
 		-sourcepath ${PATHTOROOT} $<
 
--- a/com/pixelmed/display/Makefile
+++ b/com/pixelmed/display/Makefile
@@ -130,7 +130,7 @@ include ${PATHTOROOT}/Makefile.common.mk
 
 # override javac command in Makefile.common.mk to add codec to classpath, until folded into main trunk :(
 .java.class:
-	export JAVAVERSIONTARGETJARFILE=`/usr/libexec/java_home -v ${JAVAVERSIONTARGET} | tail -1`/jre/lib/rt.jar; javac ${JAVACOPTIONS} \
+	export JAVAVERSIONTARGETJARFILE=${JAVA_HOME}/jre/lib/rt.jar; javac ${JAVACOPTIONS} \
 		-classpath ${PATHTOROOT}:${SLF4JCOMPILEADDITIONALJAR}:${DISPLAYADDITIONALJARS}:${PIXELMEDIMAGEIOJAR} \
 		-sourcepath ${PATHTOROOT} $<
 
--- a/com/pixelmed/utils/Makefile
+++ b/com/pixelmed/utils/Makefile
@@ -34,7 +34,7 @@ include ${PATHTOROOT}/Makefile.common.mk
 
 # override javac command in Makefile.common.mk to add jars needed for CapabilitiesAvailable
 .java.class:
-	export JAVAVERSIONTARGETJARFILE=`/usr/libexec/java_home -v ${JAVAVERSIONTARGET} | tail -1`/jre/lib/rt.jar; javac ${JAVACOPTIONS} \
+	export JAVAVERSIONTARGETJARFILE=${JAVA_HOME}/jre/lib/rt.jar; javac ${JAVACOPTIONS} \
 		-classpath ${PATHTOROOT}:${JPEGBLOCKREDACTIONJAR} \
 		-sourcepath ${PATHTOROOT} $<
 
--- a/com/pixelmed/slf4j/Makefile
+++ b/com/pixelmed/slf4j/Makefile
@@ -10,6 +10,6 @@ include ${PATHTOROOT}/Makefile.common.mk
 
 # override javac command in Makefile.common.mk to add slf4j to classpath
 .java.class:
-	export JAVAVERSIONTARGETJARFILE=`/usr/libexec/java_home -v ${JAVAVERSIONTARGET} | tail -1`/jre/lib/rt.jar; javac ${JAVACOPTIONS} -Xlint:unchecked \
+	export JAVAVERSIONTARGETJARFILE=${JAVA_HOME}/jre/lib/rt.jar; javac ${JAVACOPTIONS} -Xlint:unchecked \
 		-classpath ${PATHTOROOT}:${SLF4JCOMPILEADDITIONALJAR} \
 		-sourcepath ${PATHTOROOT}:${SLF4JCOMPILEADDITIONALJAR} $<
--- a/com/pixelmed/convert/Makefile
+++ b/com/pixelmed/convert/Makefile
@@ -40,7 +40,7 @@ include ${PATHTOROOT}/Makefile.common.mk
 
 # override javac command in Makefile.common.mk to add javax.json-api-1.0.jar to classpath for RawImageDescription, add CSVADDITIONALJARS for TIFFToDicom
 .java.class:
-	export JAVAVERSIONTARGETJARFILE=`/usr/libexec/java_home -v ${JAVAVERSIONTARGET} | tail -1`/jre/lib/rt.jar; javac ${JAVACOPTIONS} \
+	export JAVAVERSIONTARGETJARFILE=${JAVA_HOME}/jre/lib/rt.jar; javac ${JAVACOPTIONS} \
 		-classpath ${PATHTOROOT}:${SLF4JCOMPILEADDITIONALJAR}:${DICOMADDITIONALJARS}:${VIEWERADDITIONALJARS}:${FTPADDITIONALJARS}:${JUNITJAR}:${PATHTOADDITIONAL}/javax.json-api-1.0.jar:${CSVADDITIONALJARS} \
 		-sourcepath ${PATHTOROOT} $<
 
