| Summary: | dev-java/groovy - java.io.IOException: Cannot run program "sh": java.io.IOException: error=2, No such file or directory (incomplete PATH) | ||
|---|---|---|---|
| Product: | Gentoo Linux | Reporter: | Benedikt Waldvogel <gentoo-bugzilla> |
| Component: | [OLD] Java | Assignee: | Java team <java> |
| Status: | RESOLVED FIXED | ||
| Severity: | normal | CC: | anton0xf, the.dmol |
| Priority: | Normal | ||
| Version: | unspecified | ||
| Hardware: | AMD64 | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Package list: | Runtime testing required: | --- | |
| Bug Depends on: | 451998 | ||
| Bug Blocks: | |||
|
Description
Benedikt Waldvogel
2012-03-04 11:56:41 UTC
reason seems to be that /bin/sh is needed but PATH is set to the JVM directories only: gjl --package groovy --get-args […] export PATH="/opt/sun-jdk-1.6.0.31/bin:/opt/sun-jdk-1.6.0.31/jre/bin"; I can confirm the existence of this bug also for the 32-bit x86 platform.
Is there any workaround/fix for this problem? I do not know java-config well enough...
Mr. Waldvogel has identified the problem correctly -- running groovysh under strace shows that groovysh tries to exec the shell "sh" and fails:
[pid 25169] execve("/opt/sun-jdk-1.6.0.31/bin/sh", ["sh", "-c", "stty -g < /dev/tty"], [/* 73 vars */]) = -1 ENOENT (No such file or directory)
[pid 25169] execve("/opt/sun-jdk-1.6.0.31/jre/bin/sh", ["sh", "-c", "stty -g < /dev/tty"], [/* 73 vars */]) = -1 ENOENT (No such file or directory)
What version of java-config and groovy are you running?
When I run gjl --package groovy --get-args
I have the following output
export PATH="/opt/icedtea-bin-7.2.2.1/bin:/opt/icedtea-bin-7.2.2.1/jre/bin:${PATH}"; PATH=${PATH%:};
Thanks.
groovy: 1.7.5 java-config: 2.1.11-r3 JVM: dev-java/sun-jdk 1.7.0.5-r1 gjl --package groovy --get-args […] export PATH="/opt/oracle-jdk-bin-1.7.0.5/bin:/opt/oracle-jdk-bin-1.7.0.5/jre/bin"; […] I confirm the issue existence. $gjl --package groovy --get-args | grep PATH export ROOTPATH="/opt/sun-jdk-1.6.0.35/bin:/opt/sun-jdk-1.6.0.35/jre/bin"; export MANPATH="/opt/sun-jdk-1.6.0.35/man"; export PATH="/opt/sun-jdk-1.6.0.35/bin:/opt/sun-jdk-1.6.0.35/jre/bin"; export LDPATH="/opt/sun-jdk-1.6.0.35/jre/lib/amd64/:/opt/sun-jdk-1.6.0.35/jre/lib/amd64/native_threads/:/opt/sun-jdk-1.6.0.35/jre/lib/amd64/xawt/:/opt/sun-jdk-1.6.0.35/jre/lib/amd64/server/"; $java-config --version Java Configuration Utility Version 2.1.11 I have modified the file /usr/share/java-config-2/vm/sun-jdk-1.6 by changing PATH variable to:
PATH="${JAVA_HOME}/bin:${JAVA_HOME}/jre/bin:/bin:/usr/bin"
And now the annoying error message has vanished.
Is it correct? Is it bug in sun-jdk-1.6 ?
Updating to dev-java/java-config-2.1.12 solves the issue. No manual changes in jvm's env are required. (In reply to comment #7) > Updating to dev-java/java-config-2.1.12 solves the issue. No manual changes > in jvm's env are required. This does indeed seem to fix the issue on my system also With java-config-2.1.12 stable this should be fixed. Thanks for the report and testing. confirmed. thanks. |