Date: Thu, 13 May 2010 19:53:34 -0400 From: Jung-uk Kim <jkim@FreeBSD.org> To: freebsd-java@freebsd.org Cc: Mike Jakubik <mike.jakubik@intertainservices.com>, glewis@freebsd.org Subject: Re: realpath: : No such file or directory Message-ID: <201005131953.36641.jkim@FreeBSD.org> In-Reply-To: <201005131846.08019.jkim@FreeBSD.org> References: <4BEAC59B.9040105@intertainservices.com> <4BEB0686.6050603@intertainservices.com> <201005131846.08019.jkim@FreeBSD.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On Thursday 13 May 2010 06:46 pm, Jung-uk Kim wrote: > On Wednesday 12 May 2010 03:50 pm, Mike Jakubik wrote: > > On 5/12/2010 3:07 PM, Kostik Belousov wrote: > > > The realpath(1) was given an empty path. > > > > > > According to SUSv4, realpath(3) should return ENOENT if "A > > > component of file_name does not name an existing file or > > > file_name points to an empty string." This was recently brought > > > into standard compliance. > > > > > > Why javavm passes empty path to realpath(1), I do not know. > > > > It appears the cause is because ${JAVA_HOME} is an empty > > variable. > > > > --- > > # > > # Set up an appropriate JAVA_HOME > > # > > setJavaHome() { > > > > echo Debug JAVA_HOME: ${JAVA_HOME} > > echo Debug JAVAVM_PREFIX: ${_JAVAVM_PREFIX} > > > > # Use JAVA_HOME if it's set, unless its set to /usr/local > > if [ -n "${JAVA_HOME}" -a \ > > "`realpath "${JAVA_HOME}"`" != "`realpath > > "${_JAVAVM_PREFIX}"`" ]; then > > if [ -n "${JAVA_HOME}" -a -f > > "${JAVA_HOME}/bin/${_JAVAVM_PROG}" ]; then > > _JAVAVM_PROG_PATH="${JAVA_HOME}/bin" > > return 0 > > elif [ -n "${JAVA_HOME}" -a \ > > -f "${JAVA_HOME}/jre/bin/${_JAVAVM_PROG}" ]; then > > _JAVAVM_PROG_PATH="${JAVA_HOME}/jre/bin" > > return 0 > > fi > > fi > > > > unset JAVA_HOME > > --- > > > > When i run the above: > > > > + setJavaHome > > + echo Debug JAVA_HOME: > > Debug JAVA_HOME: > > + echo Debug JAVAVM_PREFIX: /usr/local > > Debug JAVAVM_PREFIX: /usr/local > > + realpath '' > > realpath: : No such file or directory > > The attached patch should fix the annoyance. FYI, the maintainer approved the patch and I just committed it. Jung-uk Kim
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201005131953.36641.jkim>