- Arch Linux
- #2 2017-02-04 11:02:33
- Re: JAVA_HOME not set
- #3 2017-02-04 12:54:31
- Re: JAVA_HOME not set
- #4 2017-02-04 13:00:34
- Re: JAVA_HOME not set
- #5 2017-02-04 14:39:31
- Re: JAVA_HOME not set
- #6 2017-02-04 14:51:07
- Re: JAVA_HOME not set
- #7 2017-02-04 15:00:07
- Re: JAVA_HOME not set
- #8 2017-02-04 15:14:34
- Re: JAVA_HOME not set
- How to Install Java on Arch Linux
- Step 1: Check If Java is Installed
- Step 2: Install JRE in Arch Linux
- Step 3: Install JDK in Arch Linux
Arch Linux
I am trying to install bazel, but this gives me following error:
$ pacaur -S bazel [. ] which: no javac in (/home/philipp/.local/bin:/usr/lib/colorgcc/bin/:/usr/lib/ccache/bin/:/usr/local/sbin:/usr/local/bin:/usr/bin:/opt/cuda/bin:/usr/lib/jvm/default/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl) readlink: missing operand Try 'readlink --help' for more information. INFO: You can skip this first step by providing a path to the bazel binary as second argument: INFO: ./compile.sh compile /path/to/bazel ? Building Bazel from scratch ERROR: JDK not found, please set $JAVA_HOME. ==> ERROR: A failure occurred in build(). Aborting. :: failed to build bazel package(s)
Any suggestions how to fix this?
Thanks in advance!
Last edited by oowinnetouoo (2017-02-04 10:52:44)
#2 2017-02-04 11:02:33
Re: JAVA_HOME not set
Have you checked whether javac exists on your system? It’s supposed to be /usr/bin/javac → /usr/lib/jvm/default/bin/javac. Both of them appear to be in your $PATH, so there is no need to set $JAVA_HOME.
#3 2017-02-04 12:54:31
Re: JAVA_HOME not set
If you have installed the jdk8-openjdk, jre8-openjdk, java-openjfx and icedtea-web packages it should work all the files should be included in those packages — do have these installed on your system?
“Great minds discuss ideas; average minds discuss events; small minds discuss people.” -Eleanor Roosevelt
“It is our choices, that show what we truly are, far more than our abilities.” -J. K Rowling
——
How to Ask Questions the Smart Way
#4 2017-02-04 13:00:34
Re: JAVA_HOME not set
add in this before ./compile.sh
export JAVA_HOME=/usr/lib/jvm/default
#5 2017-02-04 14:39:31
Re: JAVA_HOME not set
After installation of jdk8-openjdk, jre8-openjdk, java-openjfx and icedtea-web:
Have you checked whether javac exists on your system? It’s supposed to be /usr/bin/javac → /usr/lib/jvm/default/bin/javac. Both of them appear to be in your $PATH, so there is no need to set $JAVA_HOME.
$ ls /usr/lib/jvm/default/bin/ java keytool orbd pack200 policytool rmid rmiregistry servertool tnameserv unpack200
No javac in there
#6 2017-02-04 14:51:07
Re: JAVA_HOME not set
$pacman -S jdk7-openjdk $archlinux-java set java-7-openjdk
INFO: You can skip this first step by providing a path to the bazel binary as second argument: INFO: ./compile.sh compile /path/to/bazel ? Building Bazel from scratch ERROR: JDK version (1.7) is lower than 1.8, please set $JAVA_HOME. ==> ERROR: A failure occurred in build(). Aborting.
Obvious not working, but Java 8 also fails:
archlinux-java set java-8-openjdk
src/main/java/com/google/devtools/build/lib/server/signal/InterruptSignalHandler.java:17: warning: Signal is internal proprietary API and may be removed in a future release import sun.misc.Signal; ^ src/main/java/com/google/devtools/build/lib/server/signal/InterruptSignalHandler.java:18: warning: SignalHandler is internal proprietary API and may be removed in a future release import sun.misc.SignalHandler; ^ src/main/java/com/google/devtools/build/lib/server/signal/InterruptSignalHandler.java:17: warning: Signal is internal proprietary API and may be removed in a future release import sun.misc.Signal; ^ src/main/java/com/google/devtools/build/lib/server/signal/InterruptSignalHandler.java:18: warning: SignalHandler is internal proprietary API and may be removed in a future release import sun.misc.SignalHandler; ^ src/main/java/com/google/devtools/build/lib/server/signal/InterruptSignalHandler.java:17: warning: Signal is internal proprietary API and may be removed in a future release import sun.misc.Signal; ^ src/main/java/com/google/devtools/build/lib/server/signal/InterruptSignalHandler.java:18: warning: SignalHandler is internal proprietary API and may be removed in a future release import sun.misc.SignalHandler; ^ # # A fatal error has been detected by the Java Runtime Environment: # # SIGSEGV (0xb) at pc=0x00007f7e1183059e, pid=15805, tid=0x00007f7dfbc21700 # # JRE version: OpenJDK Runtime Environment (8.0_121-b13) (build 1.8.0_121-b13) # Java VM: OpenJDK 64-Bit Server VM (25.121-b13 mixed mode linux-amd64 compressed oops) # Problematic frame: # V [libjvm.so+0x60659e] # # Core dump written. Default location: /home/philipp/.cache/pacaur/bazel/src/core or core.15805 # # An error report file with more information is saved as: # /home/philipp/.cache/pacaur/bazel/src/hs_err_pid15805.log # # If you would like to submit a bug report, please visit: # http://bugreport.java.com/bugreport/crash.jsp # /home/philipp/.cache/pacaur/bazel/PKGBUILD: line 22: ./output/bazel: No such file or directory ==> ERROR: A failure occurred in build(). Aborting. :: failed to build bazel package(s)
I have also exported the JAVA_HOME enviroment variable,
export JAVA_HOME=/usr/lib/jvm/default
Compile warnings vanish, but segfault is still there.
Last edited by oowinnetouoo (2017-02-04 14:55:37)
#7 2017-02-04 15:00:07
Lone_Wolf Member From: Netherlands, Europe Registered: 2005-10-04 Posts: 11,069
Re: JAVA_HOME not set
that folder /usr/lib/jvm/default/bin/ needs a lot more files, looks like something went wrong with your installation .
$ pacman -Qo /usr/bin/javac /usr/bin/javac is owned by java-environment-common 2-2 $
please post pacman -Qs java
Last edited by Lone_Wolf (2017-02-04 15:00:56)
Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.
(A works at time B) && (time C > time B ) ≠ (A works at time C)
#8 2017-02-04 15:14:34
Re: JAVA_HOME not set
that folder /usr/lib/jvm/default/bin/ needs a lot more files, looks like something went wrong with your installation .
$ pacman -Qo /usr/bin/javac /usr/bin/javac is owned by java-environment-common 2-2 $
please post pacman -Qs java
local/ca-certificates-utils 20160507-1 Common CA certificates (utilities) local/geos 3.5.0-2 C++ port of the Java Topology Suite local/icedtea-web 1.6.2-2 Free web browser plugin to run applets written in Java and an implementation of Java Web Start local/java-environment-common 2-2 Common files for Java Development Kits local/java-openjfx 8.u76-2 Java OpenJFX 8 client application platform (open-source implementation of JavaFX) local/java-runtime-common 2-2 Common files for Java Runtime Environments local/jdk 8u121-1 Oracle Java Development Kit local/jdk7-openjdk 7.u111_2.6.7-1 OpenJDK Java 7 development kit local/jdk8-openjdk 8.u121-1 OpenJDK Java 8 development kit local/jre 8u121-1 Oracle Java Runtime Environment local/jre7 7u79-3 Oracle Java 7 Runtime Environment (public release - end of support) local/jre7-openjdk 7.u111_2.6.7-1 OpenJDK Java 7 full runtime environment local/jre7-openjdk-headless 7.u111_2.6.7-1 OpenJDK Java 7 headless runtime environment local/jre8-openjdk 8.u121-1 OpenJDK Java 8 full runtime environment local/jre8-openjdk-headless 8.u121-1 OpenJDK Java 8 headless runtime environment local/js 24.2.0-4 JavaScript interpreter and libraries local/js17 17.0.0-4 JavaScript interpreter and libraries (legacy) local/qt5-declarative 5.8.0-1 (qt qt5) Classes for QML and JavaScript languages local/qt5-webchannel 5.8.0-1 (qt qt5) Provides access to QObject or QML objects from HTML clients for seamless integration of Qt applications with HTML/JavaScript clients
I have also tried Oracle’s Java, but got this error:
$ archlinux-java set java-8-jdk
.WARNING: /tmp/bazel_3MOyOSVY/out/external/bazel_tools/WORKSPACE:1: Workspace name in /tmp/bazel_3MOyOSVY/out/external/bazel_tools/WORKSPACE (@io_bazel) does not match the name given in the repository's definition (@bazel_tools); this will cause a build error in future versions. # # A fatal error has been detected by the Java Runtime Environment: # # SIGSEGV (0xb) at pc=0x00007f9a2a5a9cb5, pid=24024, tid=0x00007f99fd5f6700 # # JRE version: Java(TM) SE Runtime Environment (8.0_121-b13) (build 1.8.0_121-b13) # Java VM: Java HotSpot(TM) 64-Bit Server VM (25.121-b13 mixed mode linux-amd64 compressed oops) # Problematic frame: # V [libjvm.so+0x437cb5] ciObjectFactory::get_unloaded_klass(ciKlass*, ciSymbol*, bool)+0x45 # # Core dump written. Default location: /home/philipp/.cache/pacaur/bazel/src/core or core.24024 # # An error report file with more information is saved as: # /home/philipp/.cache/pacaur/bazel/src/hs_err_pid24024.log INFO: Loading package: src # # Compiler replay data is saved as: # /home/philipp/.cache/pacaur/bazel/src/replay_pid24024.log # # If you would like to submit a bug report, please visit: # http://bugreport.java.com/bugreport/crash.jsp # scripts/bootstrap/compile.sh: line 311: 24024 Aborted (core dumped) "$/bin/java" -XX:+HeapDumpOnOutOfMemoryError -Xverify:none -Dfile.encoding=ISO-8859-1 -XX:HeapDumpPath=$ -Djava.util.logging.config.file=$/javalog.properties $ -jar $/libblaze.jar --batch --install_base=$ --output_base=$/out --install_md5= --workspace_directory=$ --nofatal_event_bus_exceptions $ $ $command --ignore_unsupported_sandboxing --startup_time=329 --extract_data_time=523 --rc_source=/dev/null --isatty=1 --ignore_client_env --client_cwd=$ "$"
Last edited by oowinnetouoo (2017-02-04 15:22:16)
How to Install Java on Arch Linux
Java is undoubtedly one of the most popular programming languages ever to grace the face of the planet, powering millions of applications both on Linux and Windows platforms.
Java comprises of JRE (Java Runtime Environment) and JDK (Java Development Toolkit). JRE is a set of software applications that help in the deployment of Java applications. JDK is a development environment necessary for the building and compilation of Java applications.
In this tutorial, we are going to take you through a step by step of how you can install Java on Arch Linux.
Step 1: Check If Java is Installed
To begin with, let’s check if Java is installed in the Arch Linux using the following command.
$ java -version OR $ which java
From the output above, it evident that Java is missing. Let’s now proceed and install both JRE and JDK which both constitute JAVA.
Step 2: Install JRE in Arch Linux
To install JRE (Java Runtime Environment), a first search which versions are available for download using the command.
$ sudo pacman -sS java | grep jre
To install the latest version of JRE, run the command.
Press Y and hit ENTER to proceed with the installation of JRE and other dependencies.
Step 3: Install JDK in Arch Linux
With JRE installed, we can proceed to install JDK on our Arch Linux system. Once again, let’s search for the versions of JDK that are available for download.
$ sudo pacman -sS java | grep jdk
The first option is usually the latest version, so to install the latest JDK, run the command.
As shown before, press Y when prompted and hit ENTER to continue with the installation process. This will take a bit more of your time, so some patience will do.
At this point, we have successfully installed JAVA on our Arch Linux system.
To verify that JAVA has indeed been installed, run.
Conclusion
In this article, we demonstrated how you can install Java on Arch Linux. You can now proceed and install applications such as Apache Tomcat, Maven, Jenkins, and Gradle.