From 43905b1e0c37d78dbed678072004b4c31fb77068 Mon Sep 17 00:00:00 2001 From: Florian Klink Date: Fri, 17 Aug 2018 16:34:42 +0200 Subject: docs: explain what jdk really points to and why --- doc/languages-frameworks/java.xml | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/doc/languages-frameworks/java.xml b/doc/languages-frameworks/java.xml index dcf4d17fa57d..06812d2df23f 100644 --- a/doc/languages-frameworks/java.xml +++ b/doc/languages-frameworks/java.xml @@ -15,13 +15,17 @@ stdenv.mkDerivation { buildPhase = "ant"; } - Note that jdk is an alias for the OpenJDK. - + Note that jdk is an alias for the OpenJDK (self-built + where available, or pre-built via Zulu). + Platforms with OpenJDK not (yet) in Nixpkgs (Aarch32, + Aarch64) point to the (unfree) + oraclejdk. + JAR files that are intended to be used by other packages should be installed - in $out/share/java. The OpenJDK has a stdenv setup hook - that adds any JARs in the share/java directories of the + in $out/share/java. JDKs have a stdenv setup hook + that add any JARs in the share/java directories of the build inputs to the CLASSPATH environment variable. For instance, if the package libfoo installs a JAR named foo.jar in its share/java -- cgit 1.4.1 From e84e2fb4342c9db9c38d3e22913385d576b84efe Mon Sep 17 00:00:00 2001 From: Florian Klink Date: Fri, 17 Aug 2018 16:35:01 +0200 Subject: docs: explain the home passthru present in all JDKs and setting JAVA_HOME where required --- doc/languages-frameworks/java.xml | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/doc/languages-frameworks/java.xml b/doc/languages-frameworks/java.xml index 06812d2df23f..1acea6a7547a 100644 --- a/doc/languages-frameworks/java.xml +++ b/doc/languages-frameworks/java.xml @@ -61,7 +61,18 @@ installPhase = ${jre}/bin/java instead of ${jdk}/bin/java, you prevent your package from depending on the JDK at runtime. - + + + + Note all JDKs passthru home, so if your application + requires environment variables like JAVA_HOME being set, that + can be done in a generic fashion with the --set argument + of makeWrapper: + + + --set JAVA_HOME ${jdk.home} + + It is possible to use a different Java compiler than javac -- cgit 1.4.1