Yay asks to install java-environment unless one is still installed


as usual, I wanted to update my AUR packages with yay, but got the following message:

$ yay -Sua
:: Searching AUR for updates...
:: There are 8 providers available for java-environment=21:
1) amazon-corretto-21-bin 2) java-openjdk-bin 3) jdk 4) jdk-openjdk-xdg 5) jdk21-jetbrains-bin 6) jdk21-jetbrains-imfix 7) liberica-jdk-full-bin 8) zulu-21-bin

Enter a number (default=1):

Why is yay asking me to install a java environment? Since I already have jre-openjdk and jre-openjdk-headless installed:

$ pacman -Qs java
local/jre-openjdk 20.0.2.u9-3
    OpenJDK Java 20 full runtime environment
local/jre-openjdk-headless 20.0.2.u9-3
    OpenJDK Java 20 headless runtime environment

Ok, they’re java 20 and not 21. But is that making a difference? I’m not that familiar with java, so I’m unsure what to do. Just waiting until java is updated through pacman or pamac, or should I install one of the versions yay suggests?

I don’t want to break anything, since I have some programms relying on java which I use on a daily basis for my work and research.

Thanks for any advice!

It looks like one of your installed packages now requires Java 21.

1 Like

That was also my first thought. But I don’t want to install a second java environment which may conflict with the jre-openjdk. So maybe better wait until the latter is updated through pacman?

I don’t think this will happen. I guess that your mysterious package is from the AUR.

Check with pamac update --aur which package this is.

The output gives a long list where dependencies are checked. And at the end, it again asks which java-environment I want to install (sorry in German):

Überprüfe stellarium Abhängigkeiten...                                                                                            
Überprüfe jabref Abhängigkeiten...
Überprüfe calcmysky Abhängigkeiten...
Überprüfe liberica-jdk-8-full-bin Abhängigkeiten...
Überprüfe jdk11-openj9-bin Abhängigkeiten...
Überprüfe jdk-microsoft-openjdk Abhängigkeiten...
Überprüfe jdk17-temurin Abhängigkeiten...
Überprüfe zulu-14-bin Abhängigkeiten...
Überprüfe amazon-corretto-8 Abhängigkeiten...
Überprüfe jdk7 Abhängigkeiten...
Überprüfe jdk8 Abhängigkeiten...
Überprüfe jdk13-openj9-bin Abhängigkeiten...
Überprüfe jdk8-dragonwell-extended-bin Abhängigkeiten...
Überprüfe zulu-16-bin Abhängigkeiten...
Überprüfe jdk8-graalvm-ee-bin Abhängigkeiten...
Überprüfe zulu-18-bin Abhängigkeiten...
Überprüfe jdk8-adoptopenjdk Abhängigkeiten...
Überprüfe amazon-corretto-11 Abhängigkeiten...
... [here some more checks for dependencies]

Wähle einen Anbieter für java-environment=21:
1:  amazon-corretto-21-bin  AUR
2:  java-openjdk-bin        21.u35-1       AUR
3:  jdk                     21-1           AUR
4:  jdk-openjdk-xdg         21.u35-1       AUR
5:  jdk21-jetbrains-bin     21b212.1-1     AUR
6:  jdk21-jetbrains-imfix   21.b212.1-1    AUR
7:  liberica-jdk-full-bin   21.0.0.u37-1   AUR
8:  zulu-21-bin             21.0.0-1       AUR

It might be package stellarium or its dependent package calcmysky

Update No weren’t those packages. Removed them since I’m not using them anymore but the java message persists…

Yay will search for updates if you command it to - $ yay -Sua did just that.

Yay isn’t simply asking to install a java environment without cause; it’s responding to your question which I’ll paraphrase here: “Are there any updates?”.

Java 20.0.2.u9-3 is found on your system; multiple sources are available for the updated Java 21.x.x - Updates are found, and so Yay answers your question with “Yes, there are. Choose one” (again, paraphrasing).

Yay will always search and give results from the AUR.

If you installed Java via AUR then it stands to reason that you could also upgrade it as needed from AUR. If you installed from the main repositories (via Pacman) you can confidently ignore AUR results and upgrade with $ pacman -Syu.

If you’re concerned that whatever software you use might have problems with an updated version of Java with all the associated bug-fixes, then maybe a good starting point would be the respective devs of that software.

Thats the case, I installed it via pacman not the AUR. Of course, I tried running pacman -Syu but it says no updates needed/available.

If 21 is the up-to-date java version, I guess pacman/pamac will update it with their next system update.

Until then, is there a way to dismiss the message yay gives when invoking it with yay -Sua, so I can install other possible updates?

Java 21 really makes a difference, because it stabilized a lot of features, that are now not longer in preview-mode, but fully available.

After you install any java-version, you are able to select any of the installed versions with:


archlinux-java status
Available Java environments:
  java-21-openjdk-bin (default)
sudo archlinux-java set java-21-openjdk-bin



It is, I got the update I think it was yesterday or the day before - I’m use Manjaro unstable repositories.

1 Like

Thanks @andreas85 thats really helpful. Didn’t know about the possibility to select the java version.

I’ll give it a try and share the results.

I’m using just stable, so the update may come in the next days. But thanks for the info

Because one of your AUR packages has java-environment=21 dependency.

Of course if you were using AUR with Arch, you wouldn’t notice that, since =21 is already in repo.

And to expand on that: Now you’ll satisfy that dependency with yet another AUR package, let’s say java-openjdk-bin and when stable branch gets its java updated, it won’t matter anyway. You’ll be forever updating that AUR package, because you won’t know any better.

AUR + Manjaro stable branch + noobs = awesome combination. :smiley:

Check with pamac checkupdates all available updates.
You can go into a partial upgrade state when you update the AUR packages manually with pamac build ....
With this, you can check which program so desperately needs Java 21.

The AUR expects that you are running Arch Linux. While Manjaro is mostly compatible there is a delay between packages getting updated on Arch and those updates getting to Manjaro stable branch.

That’s exactly what’s happened here. Arch has java 21 (so does Manjaro unstable branch which updates much quicker and so is closer to real Arch Linux).

Please read Arch User Repository - Manjaro

1 Like

Keep in mind that both pamac and yay will also return results from the AUR. I’ve notice AUR package maintainers often pride themselves in staying ahead of the curve, which isn’t always a good thing.

As you used pacman to install (from Arch repositories, assuming stable) I would just wait till the next version is deemed ready, unless there’s a specific need to upgrade sooner.

A general rule-of-thumb - if the programs you’re using have no major issues using the currently installed Java, then you can afford to wait a little to update it.

Yay will keep offering to upgrade to v21 while you have a lower iteration installed. If you’re having trouble dismissing the yay command, try ‘control + c’ to close it; and use pacman -Syu followed by pamac update instead (in that order).


1 Like

Thanks for the clarification. That was also my first conclusion.

Thats what I’m propably going to do.

And, of course, I know that Manjaro isn’t Arch itself but only depends on it. The question was more about my missing knowledge regarding java (if a missing 21 dependency can do any harm etc.) than how an Arch-based Linux system works. It’s also clear to me that if I install another java package, I will be updating both simultaneously as long as both are installed.

I always wonder what the point of such slightly cocky comments is. Whats the sense of such a forum if people with ‘too easy’ questions might feel getting mocked by some routiniers? Shouldn’t other Linux users be happy if more people use those OS’s? But such behaviour may deter many rather. I’m not a Linux pro since my childhood 30 years ago, but also not a noob. Just switched to Manjaro last year after a decade of Debian/Ubuntu which just works a little bit different. Seems that you, are using Arch, so why posting such answers in a Manjaro forum and not in the Arch forum (where such a tone seems to be much more common towards new users).

Normally I wouldn’t mind, but since I’m also trying to convince some friends, as well as some of my students to use open-source software and OS, its really annoying to be confronted with such things regularly.

Thanks to everybody for his/her comments and hints (also @zbe since his plain content was helpful) and sorry for the little outburst, but this increasingly impolite tone, which is becoming more and more common everywhere nowadays, just gets on my nerves.

Feel free to flag this post and report it to one of the admins if you think my comment was inappropriate too.

1 Like

The point is to bring awareness of how illogical advertising Manjaro as a beginner friendly distro is. It has nothing to do with you personally, but it is how it is.

Why? This is like asking “Shouldn’t mountain-lovers/hikers be happy there is an influx of new hikers in the mountains?” (even if they don’t have proper footwear, fitness level, etc.) Because they’re the ones that need saving usually.

I can only hope. :stuck_out_tongue: Unless they buy proper footwear. So to say.

Merely convincing someone isn’t enough. Are they also ready, capable and willling to do all the work that comes with it?

I guess we live in two different worlds. As I see it it’s the other way around.
Everyone is entitled to everything and god forbid you criticize something. You just come to (any) forum, put zero effort in creating a post - I mean some people can’t even write coherent sentences, let alone use proper formatting, post text instead of pictures and give any relevant info, etc. - and because it’s a forum, someone should spend any amount of time and give you the answers without “offending” you?

Again, I’m not talking about you.

Yes of course. If someone doesn’t like something you should just flag, ban and cancel it. Lol I hate this stupid mentality. We should just put a big bubble-wrap around the Earth, so no one gets hurt. :stuck_out_tongue:

I get your main point. But its like you say, we might see some things different.

Of course, you should be prepared and need to learn. But isn’t that better than excluding newbies from the beginning. I never said, Manjaro is beginner friendly. No Linux OS is if you’re only have experience in WinDumb as OS.

But I personally think a bigger community will help in many cases. Also beside using it, it can, for instance, open your eyes regarding open source/access, economy of software/hardware etc. I guess we will never run the risk of converting Linux into a new Windows

Criticising is not a problem, if it is constructive rather than kind of cocky.

Of course, you can only hope for help and constructive critic if you ask in a proper way. Those kind of questions I had in mind, not some kind of trolling.

But if the question doesn’t match your personal aspirations, you just don’t have to answer. A new user may recognise that his post was bad formulated if he gets no answers.

Finally, its also nothing against you personally. As said, I understand your points, but think, in general, with such mindsets we may not come that far in an already complicated and in many ways separated world.

So, no offence! I close the question since all this is way off topic…

Have a nice day

Yes you hit the nail on its head. But instead of that what usually happens is there are 100+ posts long threads with every possible answer going back and forth. When in the future someone tries to search something and gets to one of these threads they are just useless clutter on the internet.
So, I guess as a countermeasure (and because I can’t get out of my skin), I just have to comment on some of those. :stuck_out_tongue:

You too.

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.