Some things to try --
In the bash shell see if you can really find "java", i.e.:
type java
java is /cygdrive/c/JAVA/j2sdk1.4.2_04/bin/java
If not, then your path is not setup correctly.
If you are on Windows, you can set the path in the
MyComputerProperties...Advanced...EnvironmentVariables
panel for the system and it should show up everywhere.
Also on Windows, if you have loaded Java someplace that has
a space in the path, like "Program Files", you are basically
hosed. Sure there is some way of using stacks of "'"''"'s to
get it to work, but only a select few can and nobody does.
I use a top level /JAVA directory for everything just to
avoid path and classpath issues like this.
Finally, just in case you are actually missing the locate-jre
file, I'm attaching one from my 1.1.7 tree. It's not as
convoluted as many TOS scripts but still not transparent...
MS
泽 江 wrote:
> Hello, everyone:
> Anyone who can tell me the how the tinyos-tools package dectects the
> java path?
> I have tried the IBM JDK 1.5.0-2 ,IBM JDK 1.4.2-5 and SUN
> j2sdk-1_4_2_12, I also edit the PATH,CLASSPATH the .bashrc file in the
> user home directory.But when I run the tinyos-tools-1.2.1-3.i386.rpm, It
> says that "java not found. not installing jni code".
> when using the IBM jdk 1.4.2,after install the tinyos-tools, when
> install the tinyos-1.1.15Dec2005cvs-1.noarch.rpm, It says that
> "/etc/profile.d/tinyos.sh" line 16 /usr//local/bin/locate-jre :error no
> file
> can not find the java and javac!!
> thanks!
>
> __
> 赶快注册雅虎超大容量免费邮箱?
> http://cn.mail.yahoo.com
>
>
>
>
> ___
> Tinyos-help mailing list
> Tinyos-help@Millennium.Berkeley.EDU
> https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
#!/bin/sh
# This script attempts to locate the jre directory of the current
# Java installation, even when java is not in the path
# We only support it for Sun's Java on Windows and IBM's Java on Linux
# We require an option to specify which directory is desired:
# --java: directory with java executable
# --javac: directory with javac executable
# --jni: directory where JNI code is placed
if [ "$1" = "--jni" ]; then
jni=yes
elif [ "$1" = "--java" ]; then
java=yes
elif [ "$1" = "--javac" ]; then
javac=yes
else
echo "Usage: locate-jre --java|--javac|--jni" >&2
exit 2
fi
if [ -f /usr/bin/regtool ]; then
# Hopefully this will always work on cygwin with Sun's Java
jversion=`regtool -q get '\HKLM\SOFTWARE\JavaSoft\Java Development
Kit\CurrentVersion'`
if [ $? != 0 ]; then
exit 1
fi
jhome=`regtool -q get '\HKLM\SOFTWARE\JavaSoft\Java Development
Kit\'$jversion'\JavaHome'`
if [ $? != 0 ]; then
exit 1
fi
jhome=`cygpath -u "$jhome"`
else
# On Linux, we first try to find it from the rpm
j=`rpm -ql IBMJava2-SDK | grep -m 1 'bin/javac$'`
if [ $? != 0 ]; then
# Next we try the path. But a nasty rpm may have removed them, so we
# recreate our default path...
PATH=`bash --login -c 'echo $PATH'`
j=`which javac 2>/dev/null`
if [ $? != 0 ]; then
exit 1
fi
fi
jbin=`dirname "$j"`
jhome=`dirname "$jbin"`
fi
# These are correct for Sun's Window java and IBM's Linux java
if [ "$jni" = "yes" ]; then
dir="$jhome/jre/bin"
elif [ "$javac" = "yes" ]; then
dir="$jhome/bin"
elif [ "$java" = "yes" ]; then
dir="$jhome/jre/bin"
fi
# Check that what we found actually exists
if [ -d "$dir" ]; then
echo $dir
else
exit 1
fi
___
Tinyos-help mailing list
Tinyos-help@Millennium.Berkeley.EDU
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help