hi, i'm try to build a java package for epel-6 which use java-8. unfortunately it seem it's not enough to simple add BuildRequires: java-1.8.0-openjdk-devel since it's install it, but also still install during the mock setup session old java packages ie: java-1.5.0-gcj x86_64 1.5.0.0-29.1.el6 os 137 k java-1.6.0-sun x86_64 1:1.6.0.45-1jpp.1.el6 os 25 M java-1.7.0-ibm x86_64 1:1.7.0.5.0-1jpp.2.el6_4 os 73 M java-1.7.0-ibm-devel x86_64 1:1.7.0.5.0-1jpp.2.el6_4 os 7.5 M java-1.7.0-oracle x86_64 1:1.7.0.45-1jpp.2.el6_4 os 28 M and i'm not bale to exclude them. in rpm the is a Obsoletes: but there is no such thing as "BuildRequiresObsoletes":-(
what's more i can't run system-switch-java since it's required root access and there is no command line option to switch to a given specific java version.
so during build the system use the default javac which is not java8 but ibm's java7 (IBM J9 VM (build 2.6, JRE 1.7.0).
is there any way to force java8? or is there any way to exclude other java vm jre to install into mock during build?
thanks in advance. regards.
* Farkas Levente lfarkas@lfarkas.org [2015-03-27 10:05]:
hi, i'm try to build a java package for epel-6 which use java-8. unfortunately it seem it's not enough to simple add BuildRequires: java-1.8.0-openjdk-devel since it's install it, but also still install during the mock setup session old java packages ie: java-1.5.0-gcj x86_64 1.5.0.0-29.1.el6 os 137 k java-1.6.0-sun x86_64 1:1.6.0.45-1jpp.1.el6 os 25 M java-1.7.0-ibm x86_64 1:1.7.0.5.0-1jpp.2.el6_4 os 73 M java-1.7.0-ibm-devel x86_64 1:1.7.0.5.0-1jpp.2.el6_4 os 7.5 M java-1.7.0-oracle x86_64 1:1.7.0.45-1jpp.2.el6_4 os 28 M and i'm not bale to exclude them. in rpm the is a Obsoletes: but there is no such thing as "BuildRequiresObsoletes":-(
what's more i can't run system-switch-java since it's required root access and there is no command line option to switch to a given specific java version.
so during build the system use the default javac which is not java8 but ibm's java7 (IBM J9 VM (build 2.6, JRE 1.7.0).
is there any way to force java8? or is there any way to exclude other java vm jre to install into mock during build?
Hi,
One of your dependencies likely requires java or java-devel, or perhaps even a versioned 6/7, which is why this seems to be happening.
That said though, how are sun/oracle/ibm jdks showing up? They are not in base rhel and AFAIK EPEL does not pull from Supplementary, does it?
You can force your build to use a different JVM in a couple of ways:
1. If you are calling javac directly, use /usr/lib/jvm/java-1.8.0-openjdk/bin/javac
2. If there is additional complexity in the build e.g. ant/maven are being used, try setting JAVA_HOME and overriding PATH to put OpenJDK8 first i.e. do: $ export JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk $ export PATH=$JAVA_HOME/bin:${PATH}
This should force the usage of OpenJDK8.
Cheers, Deepak
thanks in advance. regards.
-- Levente "Si vis pacem para bellum!" -- java-devel mailing list java-devel@lists.fedoraproject.org https://admin.fedoraproject.org/mailman/listinfo/java-devel
On 03/27/2015 03:38 PM, Deepak Bhole wrote:
- Farkas Levente lfarkas@lfarkas.org [2015-03-27 10:05]:
hi, i'm try to build a java package for epel-6 which use java-8. unfortunately it seem it's not enough to simple add BuildRequires: java-1.8.0-openjdk-devel since it's install it, but also still install during the mock setup session old java packages ie: java-1.5.0-gcj x86_64 1.5.0.0-29.1.el6 os 137 k java-1.6.0-sun x86_64 1:1.6.0.45-1jpp.1.el6 os 25 M java-1.7.0-ibm x86_64 1:1.7.0.5.0-1jpp.2.el6_4 os 73 M java-1.7.0-ibm-devel x86_64 1:1.7.0.5.0-1jpp.2.el6_4 os 7.5 M java-1.7.0-oracle x86_64 1:1.7.0.45-1jpp.2.el6_4 os 28 M and i'm not bale to exclude them. in rpm the is a Obsoletes: but there is no such thing as "BuildRequiresObsoletes":-(
what's more i can't run system-switch-java since it's required root access and there is no command line option to switch to a given specific java version.
so during build the system use the default javac which is not java8 but ibm's java7 (IBM J9 VM (build 2.6, JRE 1.7.0).
is there any way to force java8? or is there any way to exclude other java vm jre to install into mock during build?
Hi,
One of your dependencies likely requires java or java-devel, or perhaps even a versioned 6/7, which is why this seems to be happening.
That said though, how are sun/oracle/ibm jdks showing up? They are not in base rhel and AFAIK EPEL does not pull from Supplementary, does it?
You can force your build to use a different JVM in a couple of ways:
- If you are calling javac directly, use
/usr/lib/jvm/java-1.8.0-openjdk/bin/javac
- If there is additional complexity in the build e.g. ant/maven are being used, try setting JAVA_HOME and overriding PATH to put OpenJDK8 first i.e. do: $ export JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk $ export PATH=$JAVA_HOME/bin:${PATH}
This should force the usage of OpenJDK8.
the real problem here is that java-1.8.0-openjdk do NOT provides java! so all other packages which requires java try to install older version, but since it's install java-1.8.0-openjdk it can't install java-1.7.0-openjdk. and this itself cause a lot's of other problems:
- first of all older jdk will be installed (sun, ibm, oracle) and if it can't find any other version then the build failed.
- the system default java never will be java-1.8.0-openjdk so all tools will be use a different java.
- even if i set in the spec file: export JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk export PATH=$JAVA_HOME/bin:${PATH} ant clean Error: Could not find or load main class org.apache.tools.ant.launch.Launcher the reason probably the same as in: https://bugzilla.redhat.com/show_bug.cgi?id=983394 https://bugzilla.redhat.com/show_bug.cgi?id=982683 but jpackage-utils not updated on epel-6 and epel-7 (javapackages-tools)
so currently it's not possible. anyway i fill a bug about it: https://bugzilla.redhat.com/show_bug.cgi?id=1208832
On 04/03/2015 01:01 PM, Farkas Levente wrote:
the real problem here is that java-1.8.0-openjdk do NOT provides java! so all other packages which requires java try to install older version, but since it's install java-1.8.0-openjdk it can't install java-1.7.0-openjdk. and this itself cause a lot's of other problems:
- first of all older jdk will be installed (sun, ibm, oracle) and if it
can't find any other version then the build failed.
RHEL packages are built and tested with default Java version and that's why they require it. Running them with OpenJDK8 was not tested and may not work.
- the system default java never will be java-1.8.0-openjdk so all tools
will be use a different java.
You can configure default system JDK/JRE version in /etc/java/java.conf file. You can set JAVA_HOME to OpenJDK8 home if you want.
- even if i set in the spec file:
export JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk export PATH=$JAVA_HOME/bin:${PATH} ant clean Error: Could not find or load main class org.apache.tools.ant.launch.Launcher the reason probably the same as in: https://bugzilla.redhat.com/show_bug.cgi?id=983394 https://bugzilla.redhat.com/show_bug.cgi?id=982683 but jpackage-utils not updated on epel-6 and epel-7 (javapackages-tools)
Known problem. Will be fixed in RHEL 6.7. RHEL 7 is not affected AFAIK (if it is then please file a bug).
On 04/03/2015 01:17 PM, Mikolaj Izdebski wrote:
- the system default java never will be java-1.8.0-openjdk so all tools
will be use a different java.
You can configure default system JDK/JRE version in /etc/java/java.conf file. You can set JAVA_HOME to OpenJDK8 home if you want.
but during the build you can't modify /etc/java/java.conf.
Known problem. Will be fixed in RHEL 6.7. RHEL 7 is not affected AFAIK (if it is then please file a bug).
so currently it's not possible to build anything in epel-6 with java-8:-(
On 04/03/2015 01:31 PM, Farkas Levente wrote:
On 04/03/2015 01:17 PM, Mikolaj Izdebski wrote:
- the system default java never will be java-1.8.0-openjdk so all tools
will be use a different java.
You can configure default system JDK/JRE version in /etc/java/java.conf file. You can set JAVA_HOME to OpenJDK8 home if you want.
but during the build you can't modify /etc/java/java.conf.
There are other ways of setting JDK to be used, which don't require root access.
1. user-specific config file: $HOME/.java/java.conf 2. app-specific config files (in case of ant these are $HOME/.ant/ant.conf and $HOME/.antrc) 3. environmental variable JAVA_HOME (as explained by Deepak)
Known problem. Will be fixed in RHEL 6.7. RHEL 7 is not affected AFAIK (if it is then please file a bug).
so currently it's not possible to build anything in epel-6 with java-8:-(
It is possible, but you'd need to use some workaround for bug 1149605.
java-devel@lists.fedoraproject.org