Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 749375 - dev-java/openjdk-jre-bin-? - Invalid System VM: openjdk-bin-8
Summary: dev-java/openjdk-jre-bin-? - Invalid System VM: openjdk-bin-8
Status: RESOLVED TEST-REQUEST
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Georgy Yakovlev
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-10-16 02:52 UTC by dan
Modified: 2020-10-18 08:25 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description dan 2020-10-16 02:52:43 UTC
I tried to install the binary version of the openjdk JRE, but when Ir run java it dies with the following message:

* Home for VM 'openjdk-bin-8' does not exist: //usr/lib/jvm//openjdk-bin-8
* Invalid System VM: openjdk-bin-8

Is this just some leftover or something? It's not even version 8, but version 11!

Why is it trying to reference this path? There is no /usr/lib/jvm path. Does it need to be created?
Comment 1 Jeroen Roovers (RETIRED) gentoo-dev 2020-10-16 09:25:09 UTC
# eselect java-vm list
Available Java Virtual Machines:
  [1]   icedtea-bin-8  system-vm

The pkg_postinst() message may also hold some clues for you.
Comment 2 Georgy Yakovlev archtester gentoo-dev 2020-10-16 09:52:13 UTC
you probably had openjdk-bin selected at some point but it may have gotten depcleaned, and now have stale entry.
select openhjdk you want with eselect.

openjdk11 does not use /usr/lib/jvm path and will not appear in eselect by default unless you unmask gentoo-vm flag for it, but I do not recommend doing it, packages will break.

use openjdk:8 or openjdk-bin:8 as system-vm.
but you can still have openjdk:11 installed in parallel, it will be available
at /usr/lib*/openjdk-11/bin/java or /opt/openjdk-bin-11/bin/java
Comment 3 dan 2020-10-16 16:04:14 UTC
I've never had Java installed before that I'm aware of. This is a fresh install, only a few days old. I have to wonder why there would even be a /usr/bin/java if the jdk/jre was removed. The only jre-bin I'm aware of ever installing is opendjk-jre-bin-11.

Oh, my eselect java-vm says NO instances of java found.

localhost ~ # eselect java-vm list
Available Java Virtual Machines:
  (none found)

Frankly, I TRIED using gentoo-vm and even when the use flag was set on the command line or in a package.use/ file, it was ignored and turned off. 

I managed a work around for now, since only one program I currently use needs the JVM and it accepts a location for it on the command line I just created a script that calls the binary with the correct jre path. Still, it's a kludge and a patch and shouldn't be needed.

As to your resolution of TEST-REQUEST, tell me how I could test this and I'll happily do it.
Comment 4 Georgy Yakovlev archtester gentoo-dev 2020-10-18 08:25:41 UTC
you did the test, I just was not clear enough =)

it's working as intended and gentoo-vm flag is not only disabled, but masked as well. so you need to unmask the flag and enable it to activate it.

VERY NOT RECOMMENDED to do it, emerge with most java things will break horribly. 

if you can run your application and call java by full path - please continue doing so, it's the intended mode of operation for openjdk-11 for now, until packages are fixed.

it will NOT appear in in eselect java-vm output, and running `java` on console will generate this error you see, because on gentoo it's just a wrapper.
and if it's not in eselect, wrapper will bail out .

sorry for this not so smooth user experience, but it's the only way to keep things sane.
java team is very understaffed and we just try to keep things afloat, so work on porting to java11 is stalled.

if you still want to unmask the flag, read this:
https://wiki.gentoo.org/wiki//etc/portage/profile/package.use.mask

but I still can't recommend doing it.

you can also just alias it in shell if you call it from command line.

> alias java='/full/path/to/openjdk/bin/java'

to satisfy muscle memory.

or create a symlink to java binary in /usr/local/bin, but it may bite you in the future, so also not recommended.