Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 181967 - java-config: Add code to /usr/bin/run-java-tool to detect if people try to run it directly
Summary: java-config: Add code to /usr/bin/run-java-tool to detect if people try to ru...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Java (show other bugs)
Hardware: All Linux
: High normal
Assignee: Java team
URL: http://overlays.gentoo.org/proj/java/...
Whiteboard:
Keywords: InVCS
Depends on:
Blocks:
 
Reported: 2007-06-13 23:07 UTC by Petteri Räty (RETIRED)
Modified: 2008-08-19 22:36 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Petteri Räty (RETIRED) gentoo-dev 2007-06-13 23:07:38 UTC
02:04 < amattas> hmm.. anyone have suggestions for this
02:04 < amattas> tony@lexus ~ $ /usr/bin/run-java-tool -version
02:04 < amattas> * run-java-tool is not available for sun-jdk-1.5 on x86_64
02:04 < amattas> * IMPORTANT: some Java tools are not available on some VMs on some architectures
02:04 <@Betelgeuse> amattas: run-java-tool is not supposed to be run directly
02:05 <@Betelgeuse> should probably add some detection code for that
02:05 < amattas> hmm I'm trying to run eclipse 3.3R4
02:05 <@Betelgeuse> https://bugs.eclipse.org/bugs/show_bug.cgi?id=176021
02:06 < Flameeyes> ServoFlame, bug eclipse 176021
02:06 < ServoFlame> Bug 176021; "[launcher] Eclipse launcher not working OOTB on Gentoo systems"; Equinox | Framework; NEW, ; eclipse@volker-wegert.de -> equinox.framework-inbox@eclipse.org;
                    https://bugs.eclipse.org/bugs/show_bug.cgi?id=176021
02:06 < Flameeyes> Betelgeuse, you could install run-java-tool into libexec... if qa decided what to do with that of course
02:06 <@Betelgeuse> that would be prudent
02:06 <@Betelgeuse> wouldn't solve the eclipse bug though
02:07 < Flameeyes> Betelgeuse, that's still a good idea, if there was a written policy, as I said
Comment 1 Uwe Sinha 2007-07-19 10:35:50 UTC
(In reply to comment #0)
> 02:04 < amattas> hmm.. anyone have suggestions for this
> 02:04 < amattas> tony@lexus ~ $ /usr/bin/run-java-tool -version
> 02:04 < amattas> * run-java-tool is not available for sun-jdk-1.5 on x86_64
> 02:04 < amattas> * IMPORTANT: some Java tools are not available on some VMs on
> some architectures
> 02:04 <@Betelgeuse> amattas: run-java-tool is not supposed to be run directly
> 02:05 <@Betelgeuse> should probably add some detection code for that
[...]

Does the patch/workaround suggested by Jakub here: http://forums.gentoo.org/viewtopic-p-4138497.html#3956448 fix this problem? 

Anyway, it works for me[TM]. I wonder why it didn't make it into java-config-2.0.33-r1...

Comment 2 Petteri Räty (RETIRED) gentoo-dev 2007-07-19 10:45:44 UTC
(In reply to comment #1)
> 
> Does the patch/workaround suggested by Jakub here:
> http://forums.gentoo.org/viewtopic-p-4138497.html#3956448 fix this problem? 
> 
> Anyway, it works for me[TM]. I wonder why it didn't make it into
> java-config-2.0.33-r1...
> 

You are expecting that we would follow the forums. I at least don't do it.
Comment 3 Petteri Räty (RETIRED) gentoo-dev 2007-07-21 11:36:14 UTC
http://overlays.gentoo.org/proj/java/changeset/5257
Comment 4 Uwe Sinha 2007-07-22 14:05:34 UTC
(In reply to comment #2)

> You are expecting that we would follow the forums. 

No, not really. It just struck me that the posting I mentioned is more than 4 months old, but as it seems has never been referenced here. So I'm rather expecting the "works for me" folks to come over here to Bugzilla and say "works for me" once more. 8-)

> I at least don't do it.
 
I only search them if I stumble across a problem not mentioned in Bugzilla yet. 
Comment 5 Uwe Sinha 2007-07-22 14:26:40 UTC
(In reply to comment #3)
> http://overlays.gentoo.org/proj/java/changeset/5257

AFAIS the problem is some Java apps (most notably Eclipse when installed from eclipse.org) trying to outsmart the underlying Linux distro by resolving symlinks time and again. Gentoo's way of handling Java, which IMO is well thought-out, may seem a little too eccentric to them. What I like about Jakub's solution is that it simply gives these apps what they are looking for (which is a Java executable).  

If, however, you are sure enough that you'll get the Eclipse folks to break Eclipse's symlink resolving habits, then the solution you posted at the above URL is probably The Right Thing[TM]. 
Comment 6 Petteri Räty (RETIRED) gentoo-dev 2007-07-22 14:37:44 UTC
(In reply to comment #5)
> 
> AFAIS the problem is some Java apps (most notably Eclipse when installed from
> eclipse.org) trying to outsmart the underlying Linux distro by resolving
> symlinks time and again. Gentoo's way of handling Java, which IMO is well
> thought-out, may seem a little too eccentric to them. What I like about Jakub's
> solution is that it simply gives these apps what they are looking for (which is
> a Java executable).  
> 

And what is to say that they are not looking for the javac executable?
Comment 7 Petteri Räty (RETIRED) gentoo-dev 2007-07-24 13:34:26 UTC
0.14 is in. I fixed java-1.5-fixer too to work with baselayout-2.
Comment 8 Petteri Räty (RETIRED) gentoo-dev 2007-08-03 15:25:06 UTC
(In reply to comment #7)
> 0.14 is in. I fixed java-1.5-fixer too to work with baselayout-2.
> 

wrong bug
Comment 9 Christoph Brill (egore) (RESIGNED) 2008-08-19 01:37:48 UTC
Another example is using InstallAnywhere-based installers. These are calling run-java-tool direct, too. I added as an (obviously) wrong workaround

if [[ "x${tool}" == "xrun-java-tool" ]]; then
        tool="java"
fi

between the lines

tool=$(basename $0)

and

bin=${vmpath}/bin/${tool}

I could at least run the installer this way.
Comment 10 Petteri Räty (RETIRED) gentoo-dev 2008-08-19 22:11:22 UTC
This has been release to main tree at some point.

betelgeuse@pena ~ $ /usr/bin/run-java-tool
* run-java-tool was invoked directly
* run-java-tool should only be used via symlinks to it
Comment 11 Christoph Brill (egore) (RESIGNED) 2008-08-19 22:23:47 UTC
(In reply to comment #10)
> This has been release to main tree at some point.
> 
> betelgeuse@pena ~ $ /usr/bin/run-java-tool
> * run-java-tool was invoked directly
> * run-java-tool should only be used via symlinks to it

From what I understood the bug was still open because of this restriction with run-java-tool. With java-config-2.1.6-r1 installed I can't run any InstallAnywhere installers. Or am I missing the point here?

Comment 12 Petteri Räty (RETIRED) gentoo-dev 2008-08-19 22:36:28 UTC
(In reply to comment #11)
> 
> From what I understood the bug was still open because of this restriction with
> run-java-tool. With java-config-2.1.6-r1 installed I can't run any
> InstallAnywhere installers. Or am I missing the point here?
> 

InstallAnywhere is expecting some kind of a JDK layout but a JDK file layout isn't standardized as far as I know.