Bug 642035 - java-functions wrapper select wrong Java version on startup
Summary: java-functions wrapper select wrong Java version on startup
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: jpackage-utils
Version: rawhide
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
Assignee: Mikolaj Izdebski
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: 641756
TreeView+ depends on / blocked
 
Reported: 2010-10-11 20:13 UTC by Cédric OLIVIER
Modified: 2012-12-20 09:27 UTC (History)
2 users (show)

Fixed In Version: 1.7.5-23
Clone Of:
Environment:
Last Closed: 2012-12-20 09:27:36 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Cédric OLIVIER 2010-10-11 20:13:53 UTC
Description of problem:

I have followed guidelines to made a wrapper script to launch josm.jar : http://fedoraproject.org/wiki/Packaging:Java#Wrapper_Scripts

If there isn't any java-1.6.0-openjdk-devel installed but java-1.5.0-gcj-devel and java-1.6.0-openjdk

The wrapper select an 1.5 java version. 

alternatives --display java is java 1.6, I am expecting that the wrapper select java 1.6

Version-Release number of selected component (if applicable):
josm-0-0.11.3592svn.fc13.noarch (problem with wrapper)
java-1.5.0-gcj
java-1.5.0-gcj-devel
java-1.6.0-openjdk

don't install java-1.6.0-openjdk-devel

How reproducible:
Try to launch josm it fail because java 1.5 is used and josm requires java 1.6 as it specified in rpm spec file.

Steps to Reproduce:
1.yum install java-1.5.0-gcj-devel
2.yum install ant josm
3.alternatives --display java is set to java 1.6
4.alternatives --display javac is set to javac 1.5
5.Try to run wrapper specified in GuideLines, there is java 1.5 selected.
  
Actual results:

Java 1.5 selected by guidelines wrapper instead of java 1.6

Expected results:
Wrapper lauching same java version as alternatives is configured (java 1.6 in this case)

Comment 1 Cédric OLIVIER 2010-11-15 20:56:48 UTC
ping ?

Comment 2 Mikolaj Izdebski 2012-12-20 09:24:34 UTC
Reproducer:
yum install java-1.5.0-gcj-devel java-1.7.0-openjdk
export _prefer_jre=1
. /usr/share/java-utils/java-functions
set_jvm
readlink -f $JAVA_HOME

Expected result: /usr/lib/jvm/java-1.7.0-openjdk-1.7.0.9.x86_64/jre
Actual result: /usr/lib/jvm/java-1.5.0-gcj-1.5.0.0

Comment 3 Mikolaj Izdebski 2012-12-20 09:27:36 UTC
I believe that this bug is fixed in jpackage-utils-1.7.5-23,
which is available in Fedora Rawhide.  I am closing the bug now,
thank you for reporting it.  A summary of changes is included below.

* Thu Dec 20 2012 Mikolaj Izdebski <mizdebsk> - 0:1.7.5-23
- Set JAVA_HOME using java (not javac) location if _prefer_jre is true
- Resolves: rhbz#642035


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