diff mbox series

[bug#40387] gnu: Set JAVA_HOME for all Java development kits.

Message ID 20200402081017.28866-1-mail@ambrevar.xyz
State Under Review
Delegated to: Christopher Baines
Headers show
Series [bug#40387] gnu: Set JAVA_HOME for all Java development kits. | expand

Checks

Context Check Description
cbaines/comparison success View comparision
cbaines/git branch success View Git branch
cbaines/applying patch success View Laminar job
cbaines/issue success View issue
cbaines/comparison success View comparision
cbaines/git branch success View Git branch
cbaines/applying patch success View Laminar job

Commit Message

Pierre Neidhardt April 2, 2020, 8:10 a.m. UTC
* gnu/packages/java.scm (icedtea-6, icedtea-7, openjdk9)[native-search-paths]:
  Set JAVA_HOME to "jre".
  This fixes issues for which the Java tooling could not find Jars,
  e.g. tools.jar.
---
 gnu/packages/java.scm | 12 ++++++++++++
 1 file changed, 12 insertions(+)

Comments

Pierre Neidhardt April 2, 2020, 8:28 a.m. UTC | #1
I cannot test this patch unfortunately, build icedtea-8 fails for me
with


--8<---------------cut here---------------start------------->8---
INFO: ZIP_DEBUGINFO_FILES=1
echo Generating precompiled header precompiled.hpp.gch
Generating precompiled header precompiled.hpp.gch
mkdir -p .
/gnu/store/x3jx25cd3q363mr7nbgzrhrv1vza6cf7-gcc-7.4.0/bin/g++ -DLINUX -D_GNU_SOURCE -DAMD64 -DPRODUCT -I. -I/tmp/guix-build-icedtea-3.7.0.drv-0/icedtea-2.6.13/openjdk/hotspot/src/share/vm/prims -I/tmp/guix-build-icedtea-3.7.0.drv-0/icedtea-2.6.13/openjdk/hotspot/src/share/vm -I/tmp/guix-build-icedtea-3.7.0.drv-0/icedtea-2.6.13/openjdk/hotspot/src/share/vm/precompiled -I/tmp/guix-build-icedtea-3.7.0.drv-0/icedtea-2.6.13/openjdk/hotspot/src/cpu/x86/vm -I/tmp/guix-build-icedtea-3.7.0.drv-0/icedtea-2.6.13/openjdk/hotspot/src/os_cpu/linux_x86/vm -I/tmp/guix-build-icedtea-3.7.0.drv-0/icedtea-2.6.13/openjdk/hotspot/src/os/linux/vm -I/tmp/guix-build-icedtea-3.7.0.drv-0/icedtea-2.6.13/openjdk/hotspot/src/os/posix/vm -I../generated -DHOTSPOT_RELEASE_VERSION="\"25.161-b12\"" -DHOTSPOT_BUILD_TARGET="\"product\"" -DHOTSPOT_BUILD_USER="\"nixbld\"" -DHOTSPOT_LIB_ARCH=\"amd64\" -DHOTSPOT_VM_DISTRO="\"OpenJDK\"" -DDERIVATIVE_ID="\"IcedTea 3.7.0\"" -DDISTRIBUTION_ID="\"Custom build\""  -DTARGET_OS_FAMILY_linux -DTARGET_ARCH_x86 -DTARGET_ARCH_MODEL_x86_64 -DTARGET_OS_ARCH_linux_x86 -DTARGET_OS_ARCH_MODEL_linux_x86_64 -DTARGET_COMPILER_gcc -DCOMPILER2 -DCOMPILER1 -fPIC -fno-rtti -fno-exceptions -D_REENTRANT -fcheck-new -fvisibility=hidden -m64  -pipe -fno-strict-aliasing  -g -fno-omit-frame-pointer -O3  -DVM_LITTLE_ENDIAN -D_LP64=1  -Wpointer-arith -Wsign-compare -Wundef -Wunused-function -Wunused-value   -g -O2 -fno-delete-null-pointer-checks -fno-lifetime-dse -std=gnu++98 -c -MMD -MP -MF ../generated/dependencies/precompiled.hpp.gch.d -fpch-deps -x c++-header /tmp/guix-build-icedtea-3.7.0.drv-0/icedtea-2.6.13/openjdk/hotspot/src/share/vm/precompiled/precompiled.hpp -o precompiled.hpp.gch 
In file included from /tmp/guix-build-icedtea-3.7.0.drv-0/icedtea-2.6.13/openjdk/hotspot/src/share/vm/precompiled/precompiled.hpp:315:0:
/tmp/guix-build-icedtea-3.7.0.drv-0/icedtea-2.6.13/openjdk/hotspot/src/share/vm/gc_implementation/parallelScavenge/parallelScavengeHeap.hpp:250:2: fatal error: can't write PCH file: No space left on device
 };
  ^
compilation terminated.
--8<---------------cut here---------------end--------------->8---

Even though I do have enough space and memory left.
Unsure what's going on.
Roel Janssen April 2, 2020, 8:56 a.m. UTC | #2
On Thu, 2020-04-02 at 10:28 +0200, Pierre Neidhardt wrote:
> I cannot test this patch unfortunately, build icedtea-8 fails for me
> with
> 
> 
> --8<---------------cut here---------------start------------->8---
> INFO: ZIP_DEBUGINFO_FILES=1
> echo Generating precompiled header precompiled.hpp.gch
> Generating precompiled header precompiled.hpp.gch
> mkdir -p .
> /gnu/store/x3jx25cd3q363mr7nbgzrhrv1vza6cf7-gcc-7.4.0/bin/g++ -DLINUX
> -D_GNU_SOURCE -DAMD64 -DPRODUCT -I. -I/tmp/guix-build-icedtea-3.7.0.drv-
> 0/icedtea-2.6.13/openjdk/hotspot/src/share/vm/prims -I/tmp/guix-build-icedtea-
> 3.7.0.drv-0/icedtea-2.6.13/openjdk/hotspot/src/share/vm -I/tmp/guix-build-
> icedtea-3.7.0.drv-0/icedtea-2.6.13/openjdk/hotspot/src/share/vm/precompiled
> -I/tmp/guix-build-icedtea-3.7.0.drv-0/icedtea-
> 2.6.13/openjdk/hotspot/src/cpu/x86/vm -I/tmp/guix-build-icedtea-3.7.0.drv-
> 0/icedtea-2.6.13/openjdk/hotspot/src/os_cpu/linux_x86/vm -I/tmp/guix-build-
> icedtea-3.7.0.drv-0/icedtea-2.6.13/openjdk/hotspot/src/os/linux/vm
> -I/tmp/guix-build-icedtea-3.7.0.drv-0/icedtea-
> 2.6.13/openjdk/hotspot/src/os/posix/vm -I../generated
> -DHOTSPOT_RELEASE_VERSION="\"25.161-b12\""
> -DHOTSPOT_BUILD_TARGET="\"product\"" -DHOTSPOT_BUILD_USER="\"nixbld\""
> -DHOTSPOT_LIB_ARCH=\"amd64\" -DHOTSPOT_VM_DISTRO="\"OpenJDK\""
> -DDERIVATIVE_ID="\"IcedTea 3.7.0\"" -DDISTRIBUTION_ID="\"Custom build\""  -
> DTARGET_OS_FAMILY_linux -DTARGET_ARCH_x86 -DTARGET_ARCH_MODEL_x86_64
> -DTARGET_OS_ARCH_linux_x86 -DTARGET_OS_ARCH_MODEL_linux_x86_64
> -DTARGET_COMPILER_gcc -DCOMPILER2 -DCOMPILER1 -fPIC -fno-rtti -fno-exceptions
> -D_REENTRANT -fcheck-new -fvisibility=hidden -m64  -pipe -fno-strict-
> aliasing  -g -fno-omit-frame-pointer -O3  -DVM_LITTLE_ENDIAN -D_LP64=1  -
> Wpointer-arith -Wsign-compare -Wundef -Wunused-function -Wunused-value   -g
> -O2 -fno-delete-null-pointer-checks -fno-lifetime-dse -std=gnu++98 -c -MMD -MP
> -MF ../generated/dependencies/precompiled.hpp.gch.d -fpch-deps -x c++-header
> /tmp/guix-build-icedtea-3.7.0.drv-0/icedtea-
> 2.6.13/openjdk/hotspot/src/share/vm/precompiled/precompiled.hpp -o
> precompiled.hpp.gch 
> In file included from /tmp/guix-build-icedtea-3.7.0.drv-0/icedtea-
> 2.6.13/openjdk/hotspot/src/share/vm/precompiled/precompiled.hpp:315:0:
> /tmp/guix-build-icedtea-3.7.0.drv-0/icedtea-
> 2.6.13/openjdk/hotspot/src/share/vm/gc_implementation/parallelScavenge/paralle
> lScavengeHeap.hpp:250:2: fatal error: can't write PCH file: No space left on
> device
>  };
>   ^
> compilation terminated.
> --8<---------------cut here---------------end--------------->8---
> 
> Even though I do have enough space and memory left.
> Unsure what's going on.
> 

Is your /tmp a separate partition, and full at the time this build fails?

Kind regards,
Roel Janssen
Pierre Neidhardt April 2, 2020, 9:03 a.m. UTC | #3
/tmp is a separate partition but it's a tmpfs, it uses my virtual
memory which is largely free (5GiB+).
Christopher Baines Dec. 18, 2020, 11:17 a.m. UTC | #4
Pierre Neidhardt <mail@ambrevar.xyz> writes:

> * gnu/packages/java.scm (icedtea-6, icedtea-7, openjdk9)[native-search-paths]:
>   Set JAVA_HOME to "jre".
>   This fixes issues for which the Java tooling could not find Jars,
>   e.g. tools.jar.

Which tools have you observed not to work? I tried running javac and I
got the help output at least.

Thanks,

Chris
Pierre Neidhardt Dec. 18, 2020, 12:31 p.m. UTC | #5
Sorry, I forgot, I've moved on since then.
Maybe it was for some Clojure thing.
diff mbox series

Patch

diff --git a/gnu/packages/java.scm b/gnu/packages/java.scm
index 4d305aac49..ca6c64fc1e 100644
--- a/gnu/packages/java.scm
+++ b/gnu/packages/java.scm
@@ -1078,6 +1078,10 @@  machine.")))
            (sha256
             (base32
              "0835lkw8vib1xhp8lxnybhlvzdh699hbi4mclxanydjk63zbpxk0"))))))
+    (native-search-paths
+       (list (search-path-specification
+              (variable "JAVA_HOME")
+              (files '("jre")))))
     (home-page "http://icedtea.classpath.org")
     (synopsis "Java development kit")
     (description
@@ -1620,6 +1624,10 @@  bootstrapping purposes.")
          ("lcms" ,lcms)
          ("zlib" ,zlib)
          ("gtk" ,gtk+-2)))
+      (native-search-paths
+       (list (search-path-specification
+              (variable "JAVA_HOME")
+              (files '("jre")))))
       (home-page "http://icedtea.classpath.org")
       (synopsis "Java development kit")
       (description
@@ -1923,6 +1931,10 @@  new Date();"))
        ("unzip" ,unzip)
        ("which" ,which)
        ("zip" ,zip)))
+    (native-search-paths
+       (list (search-path-specification
+              (variable "JAVA_HOME")
+              (files '("jre")))))
     (home-page "https://openjdk.java.net/projects/jdk9/")
     (synopsis "Java development kit")
     (description