<html>
<head>
<base href="https://issues.openmandriva.org/">
</head>
<body>
<p>
<div>
<b><a class="bz_bug_link
bz_status_RESOLVED bz_closed"
title="RESOLVED INVALID - %jar macro points to"
href="https://issues.openmandriva.org/show_bug.cgi?id=2012#c2">Comment # 2</a>
on <a class="bz_bug_link
bz_status_RESOLVED bz_closed"
title="RESOLVED INVALID - %jar macro points to"
href="https://issues.openmandriva.org/show_bug.cgi?id=2012">bug 2012</a>
from <span class="vcard"><a class="email" href="mailto:mandian@openmailbox.org" title="mandian <mandian@openmailbox.org>"> <span class="fn">mandian</span></a>
</span></b>
<pre>Thank you for replay.
<span class="quote">> rpm --eval '%jar'
> /usr/lib/jvm/java/bin/jar
>
> which works fine.</span >
You got the point. This macro doesn't work with java 7:
$ rpm --eval '%jar'
/usr/lib/jvm/jre/bin/jar
More details here:
With java 7:
$ rpm -qa | grep openjdk
java-1.7.0-openjdk-headless-1.7.0.91-2.6.3.0-omv2014.0.x86_64
java-1.7.0-openjdk-1.7.0.91-2.6.3.0-omv2014.0.x86_64
java-1.7.0-openjdk-devel-1.7.0.91-2.6.3.0-omv2014.0.x86_64
$ rpm --eval '%jar'
/usr/lib/jvm/jre/bin/jar
$ ll /usr/lib/jvm/jre/bin/jar
ls: cannot access /usr/lib/jvm/jre/bin/jar: No such file or directory
$ ll /usr/lib/jvm/jre
lrwxrwxrwx 1 root root 21 Dec 30 11:35 /usr/lib/jvm/jre ->
/etc/alternatives/jre/
$ ll /etc/alternatives/jre
lrwxrwxrwx 1 root root 59 Dec 30 11:35 /etc/alternatives/jre ->
/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.91-2.6.3.0.x86_64/jre/
$ ll /usr/lib/jvm/java-1.7.0-openjdk-1.7.0.91-2.6.3.0.x86_64/jre
total 0
drwxr-xr-x 2 root root 240 Dec 30 11:35 bin/
drwxr-xr-x 11 root root 640 Dec 30 11:35 lib/
$ ll /usr/lib/jvm/java-1.7.0-openjdk-1.7.0.91-2.6.3.0.x86_64/jre/bin/jar
ls: cannot access
/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.91-2.6.3.0.x86_64/jre/bin/jar: No such
file or directory
$ ll /usr/lib/jvm/java-1.7.0-openjdk-1.7.0.91-2.6.3.0.x86_64/jre/bin/
total 156
-rwxr-xr-x 1 root root 321 Nov 14 2015 java*
-rwxr-xr-x 1 root root 6520 Nov 14 2015 keytool*
-rwxr-xr-x 1 root root 6568 Nov 14 2015 orbd*
-rwxr-xr-x 1 root root 6528 Nov 14 2015 pack200*
-rwxr-xr-x 1 root root 6520 Nov 14 2015 policytool*
-rwxr-xr-x 1 root root 6512 Nov 14 2015 rmid*
-rwxr-xr-x 1 root root 6520 Nov 14 2015 rmiregistry*
-rwxr-xr-x 1 root root 6520 Nov 14 2015 servertool*
-rwxr-xr-x 1 root root 6576 Nov 14 2015 tnameserv*
-rwxr-xr-x 1 root root 87464 Nov 14 2015 unpack200*
$ ll /etc/alternatives/jre
lrwxrwxrwx 1 root root 59 Dec 30 11:35 /etc/alternatives/jre ->
/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.91-2.6.3.0.x86_64/jre/
$ ll /usr/lib/jvm/java-1.7.0-openjdk-1.7.0.91-2.6.3.0.x86_64/bin/jar
-rwxr-xr-x 1 root root 6512 Nov 14 2015
/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.91-2.6.3.0.x86_64/bin/jar*
$ rpm -qf /usr/lib/jvm/java-1.7.0-openjdk-1.7.0.91-2.6.3.0.x86_64/bin/jar
java-1.7.0-openjdk-devel-1.7.0.91-2.6.3.0-omv2014.0.x86_64
With java 8:
$ rpm -qa | grep openjdk
java-1.8.0-openjdk-headless-1.8.0.65-0.b17-omv2014.0.x86_64
java-1.8.0-openjdk-1.8.0.65-0.b17-omv2014.0.x86_64
java-1.8.0-openjdk-devel-1.8.0.65-0.b17-omv2014.0.x86_64
$ rpm --eval '%jar'
/usr/lib/jvm/java/bin/jar
$ rpm -qf /usr/lib/jvm/java/bin/jar
file /usr/lib/jvm/java/bin/jar is not owned by any package
$ rpm -qf /usr/lib/jvm/java/bin/
file /usr/lib/jvm/java/bin is not owned by any package
$ rpm -qf /usr/lib/jvm/java/
file /usr/lib/jvm/java is not owned by any package
$ ll /usr/lib/jvm/java
lrwxrwxrwx 1 root root 26 Oct 10 2015 /usr/lib/jvm/java ->
/etc/alternatives/java_sdk/
$ ll /etc/alternatives/java_sdk
lrwxrwxrwx 1 root root 38 Oct 10 2015 /etc/alternatives/java_sdk ->
/usr/lib/jvm/java-1.8.0-openjdk.x86_64/
$ ll /usr/lib/jvm/java-1.8.0-openjdk.x86_64
lrwxrwxrwx 1 root root 34 Oct 10 2015 /usr/lib/jvm/java-1.8.0-openjdk.x86_64
-> java-1.8.0-openjdk-1.8.0.51.x86_64/
$ ll /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.51.x86_64
total 0
drwxr-xr-x 2 root root 613 Oct 10 2015 bin/
drwxr-xr-x 3 root root 141 Oct 10 2015 include/
drwxr-xr-x 4 root root 49 Oct 10 2015 jre/
drwxr-xr-x 3 root root 165 Oct 10 2015 lib/
drwxr-xr-x 2 root root 121 Oct 10 2015 tapset/
$ rpm -qf /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.51.x86_64/bin/jar
java-1.8.0-openjdk-devel-1.8.0.51-0.b16-omv2014.0.x86_64
$ ll /etc/alternatives/jar
lrwxrwxrwx 1 root root 46 Dec 30 11:52 /etc/alternatives/jar ->
/usr/lib/jvm/java-1.8.0-openjdk.x86_64/bin/jar*
However even if it doesn't work on ABF it works well on my system. It is
because if you install only java 7 the %jar macro points to
/usr/lib/jvm/jre/bin/jar instead of /usr/lib/jvm/java/bin/jar. This changed
when I install java 8 and %jar points to /usr/lib/jvm/java/bin/jar as it
should. Then in I uninstall java 8 the macro still points to
/usr/lib/jvm/java/bin/jar and all works fine. But on ABF only java 7 is
installed so it fails.
<span class="quote">> as a starting point you could try requiring javapackages-tools instead of
> java-rpmbuild/jpackage-utils perhaps.</span >
Them all are provided by javapackages-tools:
$ rpm -qf /usr/lib/jvm
javapackages-tools-3.4.2-3.1-omv2014.0.noarch
$ urpmq --provides javapackages-tools
config(javapackages-tools)[== 0:3.4.2-3.1:2014.0]
java-rpmbuild[== 3.4.2-3.1:2014.0]
jpackage-utils[== 3.4.2-3.1:2014.0]
mvn(com.sun:tools)[== SYSTEM]
mvn(sun.jdk:jconsole)[== SYSTEM]
javapackages-tools[== 3.4.2-3.1:2014.0]
However I am often in trouble with packaging due to the lack of packaging
guideline ion our wiki. So for Java packaging usually I use to use (except the
specific requires)
BuildRequires: java-rpmbuild
[ BuildRequires: maven-local (when needed)]
[ BuildRequires: ant (when needed)]
Requires: java [-headless (when possible)]
Requires: jpackage-utils
but perhaps I should also use
BuildRequires: java-devel
Could you please give ma a suggest on this point?
<span class="quote">> 2014 is also close to EOL.</span >
Is there a date already? I hope it after the end of February 2017 (or after the
lx3.02 release) because I need of LVM support.</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are watching all bug changes.</li>
</ul>
</body>
</html>