- Arch Linux User Repository
- valsaven commented on 2023-06-19 06:48 (UTC)
- azzbcc commented on 2023-05-13 06:29 (UTC)
- hugegameartgd commented on 2022-05-06 22:43 (UTC) (edited on 2022-05-06 22:44 (UTC) by hugegameartgd)
- dbermond commented on 2022-05-05 20:38 (UTC)
- MidnightStarSign commented on 2022-05-05 19:30 (UTC)
- dbermond commented on 2022-03-24 13:51 (UTC)
- dimich commented on 2022-01-20 15:40 (UTC) (edited on 2022-01-20 16:59 (UTC) by dimich)
- drslmr commented on 2021-11-22 14:00 (UTC)
- drslmr commented on 2021-11-12 09:20 (UTC)
- 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
- How to install Java on Arch Linux
- 8 Answers 8
Arch Linux User Repository
@azzbcc @valsaven Package updated. Fix applied, thanks for noticing.
valsaven commented on 2023-06-19 06:48 (UTC)
@dbermond Could you fix the paths, please? This is easy to change by hand, but not everyone reads the comments and will notice it.
azzbcc commented on 2023-05-13 06:29 (UTC)
wrong path in java.desktop and jconsole.desktop
hugegameartgd commented on 2022-05-06 22:43 (UTC) (edited on 2022-05-06 22:44 (UTC) by hugegameartgd)
Maybe upgrading would work with provides = jre18-jdk=18.0.1 instead of 18.0.1-1 in .SRCINFO?
dbermond commented on 2022-05-05 20:38 (UTC)
@MidnightStarSign Sorry, but distributions other than Arch Linux are not supported here. Please seek help on your distribution support channels.
MidnightStarSign commented on 2022-05-05 19:30 (UTC)
I’m encountering an issue where I upgrade this using pamac, but the update is still available despite it being successful.
I found this from another forum regarding the issue: «The maintainer changed the package versioning pattern and did not adopt .SRCINFO, hence AUR helpers interpret that in a way that there is a new update available although there isn’t».
Not sure if that is what’s going on here.
Checking keyring. [1/1] Checking integrity. [1/1] Loading package files. [1/1] Checking file conflicts. [1/1] Checking available disc space. [1/1] Reinstalling jre (17.0.1-1). [1/1] Transaction successfully finished.
dbermond commented on 2022-03-24 13:51 (UTC)
For users wanting the Oracle Java LTS release, there are now lts packages for convenience: jdk-lts, jre-lts and jdk-lts-doc.
dimich commented on 2022-01-20 15:40 (UTC) (edited on 2022-01-20 16:59 (UTC) by dimich)
UPD: Hm, nevermind. Now downloaded successfully without any changes. Maybe some malfunction of the server.
Seems Oracle doesn’t allow to download jdk-14.0.2_linux-x64_bin.tar.gz directly from script any more:
Sorry! In order to download products from Oracle Technology Network you must agree to the OTN license terms. Be sure that. Your browser has "cookies" and JavaScript enabled. You clicked on "Accept License" for the product you wish to download. You attempt the download within 30 minutes of accepting the license.
drslmr commented on 2021-11-22 14:00 (UTC)
Update to my last comment:
My issue was, that I get this «undefined symbol: ipv6_available» when executing jar and other jdk executables.
Now I see that un-setting LD_LIBRARY_PATH in the bash shell fixes the problem too.
I tried to find who (which service/program) sets LD_LIBRARY_PATH , in my case to /usr/lib:/usr/lib:/usr/lib:/usr/lib , but I could not find it, neither in my user resource file nor in the system resource files I know off.
drslmr commented on 2021-11-12 09:20 (UTC)
I needed to add the server path to the LD_LIBRARY_PATH.
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.
How to install Java on Arch Linux
I already commented out my nearest Pacman repository in /etc/pacman.d/mirrorlist and ran a first update by invoking pacman -Syu hoping that this would cause the package above to be discovered. How can I install Open JDK 7 on Arch Linux using pacman? Edit: I’m running a Raspberry Pi with an ARM processor and I’m hoping to get a Java build that is tailored for its hardware and uses the OS hardware floating point support.
It finds one, extra/openjdk6 6.b24_1.11.4-1 . I tried several combinations, but pacman -S openjdk6 was not one of them. It’s an old version, and it seems to give me just a JRE instead of a complete JDK.
8 Answers 8
Get the best mirror near you (check this list); you can even generate a new mirror list on the archlinux website. Then run # pacman -Syy; # pacman -Su; # pacman -S jdk8-openjdk (or jre8-openjdk if you only need the JRE)
+1, this is (almost) the way I would do it. One note, do NOT do pacman -Syy , use pacman -Syu . Partial upgrades are unsupported.
Try the following command:
OpenJDK is a dependency on multiple Arch Linux packages so just installing Oracle’s JDK wasn’t enough.
First had to remove icedtea-web
Then build Oracle JRE AUR package,
Before installing OracleJRE I had to remove openjdk6 manually and ignore dependencies:
[argy@Freak jre]$ sudo pacman -Rdd openjdk6
sudo pacman -U jre-7u2-1-i686.pkg.tar.xz
Build and Install JDK AUR package:
sudo pacman -U jdk-7u2-1-i686.pkg.tar.xz
Logout and Login so the PATH gets updated and java is installed.
Please do not advise users to install unofficial packages right away while the piece of software OP is looking for is available in an official repo. OP should maybe just refresh the package lists first pacman -Sy . Answer from ilpianista is the correct one.
When you change your repository it is a good idea to update using pacman -Syyu as this will refresh all the packages.
RB based on armv6l. checking here you can see that there is not packaged version of openjdk for armv6l.
and here is what my arch on raspi shows
[root@raspi ~]# pacman -Ss openjdk extra/openjdk6 6.b24_1.11.4-1 Free Java environment based on OpenJDK 6.0 with IcedTea6 replacing binary plugs. [root@raspi ~]#
Or you may completely skip pacman and take full control:
- Download the tar.gz of the JDK version you need from https://adoptopenjdk.net/
- Expand the archive: tar zxvf OpenJDKxxx.ta.gz
- Move the JDK to /opt : sudo mv jdk-xxx /opt
- Update the PATH :
export JAVA_HOME=/opt/jdk-xxx export PATH=$PATH:$JAVA_HOME/bin
This way you can install as many different versions of the JDK you want and switch between them by changing the value of PATH
Due to the current procedure of downloading and installing of Oracle JDK, you may not able to do that easily with linux environment. Because lots of previously supported JDK packages are not working now. if you wish to install Oracle JDK-8 on your arch-linux / manjaro machine, this gist will guide you well.
The solution will be briefly as below.
- First need to clone relevant JDK git to your PC. cd ~/Downloads && git clone https://aur.archlinux.org/jdk8.git
- Now you should have a jdk8 folder in Downloads. Move that «.tar.gz» which you downloaded from oracle to that folder, If it is also in downloads, and I got the filename right, the command would be like this. mv ~/Downloads/jdk-8u212-linux-x64.tar.gz ~/Downloads/jdk8/
- Now we will enter the jdk8 folder and should edit the PKGBUILD. cd jdk8 && nano PKGBUILD
- The source line we want to change from is. «https://download.oracle.com/otn-pub/java/jdk/$-$/$/$-$-linux-x64.tar.gz» to the filename we now have in folder, jdk-8u212-linux-x64.tar.gz
- Save and exit the PKGBUILD. Now we can build and install from within that directory. makepkg -sric
- If everything looks like it went fine you can just remove that directory when you are done. cd ~ && rm -r ~/Downloads/jdk8