Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 280629

Summary: kde-base/krossjava-4.6.0 fails to install (cant find java)
Product: Gentoo Linux Reporter: Lóránt Farkas <lfarkas>
Component: [OLD] KDEAssignee: Gentoo KDE team <kde>
Status: RESOLVED FIXED    
Severity: normal CC: daggs, dilfridge, fauli, java, marek, xarthisius, zeekec
Priority: High    
Version: unspecified   
Hardware: AMD64   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 313999    
Attachments: build.log
emerge --info
Output of emerge --info
build.log

Description Lóránt Farkas 2009-08-07 06:43:23 UTC
I have tried to install the above package it builds but fails to install



Reproducible: Always
Comment 1 Lóránt Farkas 2009-08-07 06:44:28 UTC
Created attachment 200475 [details]
build.log
Comment 2 Lóránt Farkas 2009-08-07 06:45:16 UTC
Created attachment 200477 [details]
emerge --info
Comment 3 Ondřej Súkup 2009-08-07 14:51:55 UTC
have you emerged kdedevplatform? 
Comment 4 Lóránt Farkas 2009-08-08 18:12:09 UTC
No. I will try. But in this case this is a bug in the ebuild. kdedevplatform is not mentioned in the DEPEND nor th RDEPEND section in the ebuild.
Comment 5 Tomáš Chvátal (RETIRED) gentoo-dev 2009-08-09 10:32:01 UTC
That aint so big problem.
Problem is this:
--   JAVA_AWT_LIB_PATH: 
--   JAVA_JVM_LIB_PATH: 
--   JAVA_INCLUDE_PATH: JAVA_INCLUDE_PATH-NOTFOUND
--   JAVA_INCLUDE_PATH2: JAVA_INCLUDE_PATH2-NOTFOUND
--   JAVA_AWT_INCLUDE_PATH: JAVA_AWT_INCLUDE_PATH-NOTFOUND
--   JAVA_JVM_LIBRARY: JAVA_JVM_LIBRARY-NOTFOUND

it cant find java...
Comment 6 Christian Faulhammer (RETIRED) gentoo-dev 2009-12-18 09:12:42 UTC
The problem is still valid with 4.3.3
Comment 7 Andreas K. Hüttel archtester gentoo-dev 2010-02-16 20:03:39 UTC
Hmm, seems to work fine here (kde-4.4.0).

-- using FindJNI.cmake
--   JAVA_HOME: /etc/java-config-2/current-system-vm
--   JAVA_AWT_LIB_PATH:
--   JAVA_JVM_LIB_PATH:
--   JAVA_INCLUDE_PATH: /etc/java-config-2/current-system-vm/include
--   JAVA_INCLUDE_PATH2: /etc/java-config-2/current-system-vm/include/linux
--   JAVA_AWT_INCLUDE_PATH: /etc/java-config-2/current-system-vm/include
--   JAVA_JVM_LIBRARY: /etc/java-config-2/current-system-vm/jre/lib/amd64/server/libjvm.so
-- Build Kross Java... yes
Comment 8 Andreas K. Hüttel archtester gentoo-dev 2010-02-16 20:04:41 UTC
Created attachment 219917 [details]
Output of emerge --info
Comment 9 DaggyStyle 2010-03-03 21:45:14 UTC
same thing with 4.4.1
Comment 10 Andreas K. Hüttel archtester gentoo-dev 2010-03-11 21:07:28 UTC
(In reply to comment #9)
> same thing with 4.4.1
> 

Meaning, it works/installs or it does not work/does not install? please clarify!
Comment 11 DaggyStyle 2010-03-12 06:29:04 UTC
(In reply to comment #10)
> (In reply to comment #9)
> > same thing with 4.4.1
> > 
> 
> Meaning, it works/installs or it does not work/does not install? please
> clarify!
> 

seems to install fine now, nevermind. (comp has apparently mood swings...)
Comment 12 Andreas K. Hüttel archtester gentoo-dev 2010-03-31 22:40:31 UTC
OK, let's assume it is fixed in 4.4.x then. Please reopen if you disagree. 
Comment 13 Erik Zeek 2010-06-08 05:46:14 UTC
I just got bit by this on kde-base/krossjava-4.4.4, but I seem to have gotten around it.

Running emerge with sudo didn't work.  Running with "su -c" worked.  Probably because sudo clears the environment, including the JAVA* variables, while su doesn't.
Comment 14 Andreas K. Hüttel archtester gentoo-dev 2010-06-08 13:51:23 UTC
(In reply to comment #13)
> I just got bit by this on kde-base/krossjava-4.4.4, but I seem to have gotten
> around it.
> 
> Running emerge with sudo didn't work.  Running with "su -c" worked.  Probably
> because sudo clears the environment, including the JAVA* variables, while su
> doesn't.
> 

That is, however, not how it should work. Emerge should be independent from the user environment. Reopening...
Comment 15 Maciej Mrozowski gentoo-dev 2010-06-08 15:13:19 UTC
This is portage or java-config bug and we (gentoo kde folks) can't really do anything about it.
It's similar issue as those related to boost or python - anything using eselect.
User needs to ensure correct (and what's important) - any java is enabled and present in environment - so source /etc/profile may be needed before running emerge.
Comment 16 Erik Zeek 2010-06-08 15:44:23 UTC
(In reply to comment #15)
> This is portage or java-config bug and we (gentoo kde folks) can't really do
> anything about it.

Accepted.

> It's similar issue as those related to boost or python - anything using
> eselect.
> User needs to ensure correct (and what's important) - any java is enabled and
> present in environment - so source /etc/profile may be needed before running
> emerge.
> 

The problem is, that while java is enabled and in the environment, sudo wipes the environment before running the command.  Sourcing /etc/profile won't help.  What will help is adding the various JAVA* variables to the env_keep in the sudoers file.  I added the following to sudoers:

Defaults:%portage      env_keep += "JAVAC JAVACC_HOME JAVA_HOME JDK_HOME"

and was able to emerge krossjava.

The problem I see with this, is that it is using the users vm instead of the system vm for the install.  Not a big issue for me (they're the same), but it could be for others.
Comment 17 Jorge Manuel B. S. Vicetto (RETIRED) Gentoo Infrastructure gentoo-dev 2010-06-08 18:17:21 UTC
*** Bug 323223 has been marked as a duplicate of this bug. ***
Comment 18 Andreas K. Hüttel archtester gentoo-dev 2010-06-09 20:20:47 UTC
Should be solved by proper use of the java eclasses. I'll try during the next days....
Comment 19 Andreas K. Hüttel archtester gentoo-dev 2010-06-10 16:05:47 UTC
Fixed in the overlay, please test.
Comment 20 Erik Zeek 2010-06-10 16:36:25 UTC
(In reply to comment #19)
> Fixed in the overlay, please test.
> 

I had to add an export to the JAVA_HOME variable to get it to work.

 src_configure() {
        mycmakeargs=(-DENABLE_KROSSJAVA=ON)
+       export JAVA_HOME=$(java-config -g JAVA_HOME)
        kde4-meta_src_configure
        java-ant-2_src_configure
 }
Comment 21 Andreas K. Hüttel archtester gentoo-dev 2010-06-10 17:58:58 UTC
(In reply to comment #20)
> (In reply to comment #19)
> > Fixed in the overlay, please test.
> > 
> 
> I had to add an export to the JAVA_HOME variable to get it to work.
> 

Hmm, strange. Well I guess it can't hurt. Added in overlay. 
Comment 22 Maciej Mrozowski gentoo-dev 2010-06-11 02:04:54 UTC
Fixed in 4.3.3, 4.3.5 and 4.4.4.
Thanks for all involved!
Comment 23 Kacper Kowalik (Xarthisius) (RETIRED) gentoo-dev 2011-02-02 16:08:58 UTC
exporting JAVA_HOME in src_configure doesn't fix it. Just hit it with 4.6.0
Comment 24 Kacper Kowalik (Xarthisius) (RETIRED) gentoo-dev 2011-02-03 15:14:38 UTC
Created attachment 261417 [details]
build.log

Build log for 4.6.0
Comment 25 Theo Chatzimichos (RETIRED) archtester gentoo-dev Security 2011-02-03 15:44:11 UTC
i was able to reproduce with dev-java/ibm-jdk-bin-1.6.0.9, it compiles fine with icedtea6 though
Comment 26 Lóránt Farkas 2011-02-14 20:58:47 UTC
(In reply to comment #24)
> Created an attachment (id=261417) [details]
> build.log
> 
> Build log for 4.6.0
> 

As I see it is a completely unrelated probem (ebuild doesn't find the kdepimlibs). So please open a new bugreport for this.
Comment 27 Lóránt Farkas 2011-02-14 21:00:36 UTC
(In reply to comment #25)
> i was able to reproduce with dev-java/ibm-jdk-bin-1.6.0.9, it compiles fine
> with icedtea6 though
> 

What was ibm-jdk-bin and icedtea6? The system java-vm, user java-vam, both?
Comment 28 Theo Chatzimichos (RETIRED) archtester gentoo-dev Security 2011-03-05 17:51:08 UTC
(In reply to comment #26)
> As I see it is a completely unrelated probem (ebuild doesn't find the
> kdepimlibs). So please open a new bugreport for this.

No, ignore the kdepimlibs warnings, the important part is the following, and I am able to reproduce it:

-- Could NOT find JNI  (missing:  JAVA_JVM_LIBRARY JAVA_INCLUDE_PATH2) 
-- using FindKrossJNI.cmake
--   JAVA_HOME: /opt/ibm-jdk-bin-1.6.0.9
--   JAVA_AWT_LIB_PATH: 
--   JAVA_JVM_LIB_PATH: 
--   JAVA_INCLUDE_PATH: /opt/ibm-jdk-bin-1.6.0.9/include
--   JAVA_INCLUDE_PATH2: JAVA_INCLUDE_PATH2-NOTFOUND
--   JAVA_AWT_INCLUDE_PATH: /opt/ibm-jdk-bin-1.6.0.9/include
--   JAVA_JVM_LIBRARY: JAVA_JVM_LIBRARY-NOTFOUND

(In reply to comment #27)
> What was ibm-jdk-bin and icedtea6? The system java-vm, user java-vam, both?

How can I see that? java n00b here
Comment 29 Andreas K. Hüttel archtester gentoo-dev 2011-04-10 19:27:44 UTC
We could need some help from the java team here.
Comment 30 Serkan Kaba (RETIRED) gentoo-dev 2011-04-11 04:16:27 UTC
please provide output of `java-config -L` as root
Comment 31 Serkan Kaba (RETIRED) gentoo-dev 2011-04-11 04:20:23 UTC
(In reply to comment #20)
> (In reply to comment #19)
> > Fixed in the overlay, please test.
> > 
> 
> I had to add an export to the JAVA_HOME variable to get it to work.
> 
>  src_configure() {
>         mycmakeargs=(-DENABLE_KROSSJAVA=ON)
> +       export JAVA_HOME=$(java-config -g JAVA_HOME)
>         kde4-meta_src_configure
>         java-ant-2_src_configure
>  }

This shouldnt be needed actually kde4-meta eclass' pkg_setup is shadowing java's where all initilization of java eclass takes place.
Comment 32 Serkan Kaba (RETIRED) gentoo-dev 2011-04-11 04:35:57 UTC
(In reply to comment #31)
> This shouldnt be needed actually kde4-meta eclass' pkg_setup is shadowing
> java's where all initilization of java eclass takes place.
pkg_preinst is shadown as well
Comment 33 Theo Chatzimichos (RETIRED) archtester gentoo-dev Security 2011-04-12 02:18:34 UTC
thank you Serkan and everyone else involved
fix was committed by Jonathan, closing