Bug 983677 - Java won't work after install/upgrade
Java won't work after install/upgrade
Product: Fedora
Classification: Fedora
Component: java-1.7.0-openjdk (Show other bugs)
i686 Linux
unspecified Severity medium
: ---
: ---
Assigned To: jiri vanek
Fedora Extras Quality Assurance
: 990346 (view as bug list)
Depends On:
  Show dependency treegraph
Reported: 2013-07-11 13:10 EDT by Fernando Lozano
Modified: 2013-08-05 08:45 EDT (History)
11 users (show)

See Also:
Fixed In Version: java-1.7.0-openjdk-
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2013-07-30 13:47:34 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Fernando Lozano 2013-07-11 13:10:45 EDT
This is related to https://bugzilla.redhat.com/show_bug.cgi?id=979128 which was closed but the problem wasn't solved.

Description of problem:

Agter installing anew, or upgrading to Fedora 19, the command "java" is not found by the shell.

Version-Release number of selected component (if applicable):

How reproducible:

Allways. Tried on five different computers so farm using different installation methods. yum update didn't change the problem.

Steps to Reproduce:
1. Install or upgrade a Fedora system to F19
2. Log in and open a shell
3. Try to run "java -version" or any other java command line

Actual results:

"java": Command not found

Expected results:

Normal output from the java command, which is installed by default.

Additional info:

This is a minor bug, but a big annoyance for anyone who uses java on Fedora.

I saw the same issue initially on two diferent systems: one upgraded from F17 to F19 via fedup, another installed clean from live media. Both had yum -y update after installation. Both were 32-bit machines, I did not test on x86_64 yet.

Later I tried other systems, installing from DVD, same results. :-(

"java" is not on the classpath after install, altough java-1.7.0-openjdk comes installed by default. See [ I hope eveyone can understand this termina session even if it's in portuguese ]:


[root@lgx200 ~]# java -version
bash: java: Comando não encontrado...

[root@lgx200 ~]# yum -y install java-1.7.0-openjdk icedtea-web
Plugins carregados: langpacks, refresh-packagekit
updates/19/i386/metalink                                      | 1.8 kB  00:00:00     
O pacote 1:java-1.7.0-openjdk- já está instalado em sua última versão
O pacote icedtea-web-1.4-2.fc19.i686 já está instalado em sua última versão
Nada a ser feito

So I checked alternaives:


root@lgx200 ~]# alternatives --config java

Há 3 programas que oferecem "java".

  Seleção    Comando
*+ 1           /usr/lib/jvm/jre-1.7.0-openjdk/bin/java
   2           /usr/lib/jvm/jre-1.5.0-gcj/bin/java
   3           /usr/lib/jvm/jre-1.7.0-openjdk.i386/bin/java

Indique para manter a seleção atual[+] ou digite o número da seleção:

There was a default java configured, but there's nothing on the path specified by [1]:

[lozano@lgx200 ~]$ ls /usr/lib/jvm/
java-1.5.0-gcj-           jre-1.5.0/
java-1.7.0-openjdk- jre-1.5.0-gcj/
java-1.7.0-openjdk.i386/          jre-1.7.0-openjdk.i386/
jre/                              jre-gcj/

I fixed this issue by running alternatives --config again, then choosing [3]. Now "java" works fine on the shell.

I guess there should be no "/usr/lib/jvm/jre-1.7.0-openjdk/bin/java" in alternatives, or this path should be a symlink to /usr/lib/jvm/jre-1.7.0-openjdk.i386/bin/java, in which case there shouldn't be this latest option in alternatives.

Maybe the intent was to have 32-bit and 64-bit OpenJDK on the same machine, and allow the user to choose each one as the default java.

Anyway, not having a default java on the system PATH is a serious regression. We are back to old fime tar.gz Java from Sun, having to setup the environment, something rpm packages are supposed to do by themselves.
Comment 1 Fedora Update System 2013-07-20 11:33:46 EDT
java-1.7.0-openjdk- has been submitted as an update for Fedora 19.
Comment 2 Fedora Update System 2013-07-21 20:38:49 EDT
Package java-1.7.0-openjdk-
* should fix your issue,
* was pushed to the Fedora 19 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing java-1.7.0-openjdk-'
as soon as you are able to.
Please go to the following url:
then log in and leave karma (feedback).
Comment 3 Fedora Update System 2013-07-22 05:18:48 EDT
java-1.7.0-openjdk- has been submitted as an update for Fedora 19.
Comment 4 Fedora Update System 2013-07-30 13:47:34 EDT
java-1.7.0-openjdk- has been pushed to the Fedora 19 stable repository.  If problems still persist, please make note of it in this bug report.
Comment 5 Heldwin 2013-07-31 19:58:44 EDT
There is still the problem.

After updating to java-1.7.0-openjdk-, java is now broken on my system, as most the symlinks are on /usr/lib/jvm/jre-1.7.0-openjdk , in /etc/alternatives.

Choosing option 2 in: alternatives --config java :
*  1           /usr/lib/jvm/jre-1.7.0-openjdk.x86_64/bin/java
 + 2           /usr/lib/jvm/java-1.7.0-openjdk-

returns an answer with: java -version, but the symlinks are all messed up

If I install java-1.7.0-openjdk on a system that never installed java, it is ok, but not if there was already java installed.
Comment 6 Heldwin 2013-07-31 20:43:24 EDT
a downgrade http://kojipkgs.fedoraproject.org/packages/java-1.7.0-openjdk/ to:
* java-1.7.0-openjdk-
* java-1.7.0-openjdk-devel- 

fixes it

If I try to install:
* java-1.7.0-openjdk-{9,10,11}.fc19.x86_64
* java-1.7.0-openjdk-devel-{9,10,11}.fc19.x86_64 

It breaks almost all symlinks
Comment 8 Heldwin 2013-07-31 21:53:46 EDT
Yes. It helps.

There is still these symlinks broken:

* /etc/alternatives
java_sdk_1.7.0_openjdk -> /usr/lib/jvm/%{sdklnk}
java_sdk_1.7.0_openjdk_exports -> /usr/lib/jvm-exports/java-1.7.0-openjdk-
javadocdir -> /usr/share/javadoc/java-1.7.0-openjdk/api

* /usr/lib/jvm
java-1.7.0-openjdk -> /etc/alternatives/java_sdk_1.7.0_openjdk
jre-1.7.0_openjdk -> /etc/alternatives/jre_1.7.0_openjdk
javadocdir -> /usr/share/javadoc/java-1.7.0-openjdk/api

* /usr/share/javadoc
java -> /etc/alternatives/javadocdir

But seeing 
alternatives --config java , switches now automatically from:
*+ 1           /usr/lib/jvm/jre-1.7.0-openjdk.x86_64/bin/java

*  1           /usr/lib/jvm/jre-1.7.0-openjdk.x86_64/bin/java
 + 2           /usr/lib/jvm/java-1.7.0-openjdk-
Comment 9 Severin Gehwolf 2013-08-05 08:45:05 EDT
*** Bug 990346 has been marked as a duplicate of this bug. ***

Note You need to log in before you can comment on or make changes to this bug.