Jump to content

Configure: error: Unable to locate /usr/local/java/bin


Recommended Posts

I am trying to upgrade php and have two questioins.

1) Do I need  to uninstall my current installation of php before upgrading, or can I just overwrite the current installation?

2) I have so far managed to download and unzip the source for php4.4.4.  However, when I try to configure my installation using the command line

'./configure' '--with-apxs=/usr/sbin/apxs' '--enable-safe-mode' '--with-zlib-dir=/usr/local/phplibs' '--with-curl=/usr/local/phplibs' '--with-dom' '--enable-ftp' '--with-gd=/usr/local/phplibs' '--with-jpeg-dir=/usr/local/phplibs' '--with-png-dir=/usr/local/phplibs' '--with-ttf=/usr/local/phplibs' '--with-freetype-dir=/usr/local/phplibs' '--with-t1lib=/usr/local/phplibs' '--with-iconv=/usr/local/phplibs' '--with-kerberos' '--with-ldap' '--enable-mbstring' '--with-mcrypt=/usr/local/phplibs' '--with-mysql=/usr/local/mysql' '--with-pgsql=/usr/local/phplibs' '--with-regex=system' '--with-pear' '--enable-memory-limit' '--enable-bcmath' '--enable-calendar' '--enable-dbase' '--enable-exif' '--with-zlib-dir=/usr/local/phplibs' '--with-gmp=/usr/local/phplibs' '--with-mhash=/usr/local/phplibs' '--with-gettext' '--enable-mbregex' '--disable-mbstr-enc-trans' '--enable-track-vars' '--enable-xml' '--with-xmlrpc' '--enable-xslt' '--with-xslt-sablot=/usr/local/phplibs' '--with-iconv-dir=/usr/local/phplibs' '--with-expat-dir=/usr/local/phplibs' '--enable-zend-multibyte' '--enable-dba' '--with-db4=/usr/local/phplibs' '--with-bz2' '--enable-dbx' '--with-mcal=/usr/local/phplibs' '--with-java=/usr/local/java' '--with-imap=/usr/local/phplibs/imap-2004f' '--with-openssl' '--with-magickwand=/usr/local/phplibs' '--with-imap-ssl'

(I obtained this from phpinfo()), it fails with the error messages

checking for Java support... yes
checking Java Jar location... configure: error: Unable to locate /usr/local/java/bin

The 'directory' /usr/local/java is a sym link to /usr/local/jre1.5.0_01/ which in turn has a subdirectory bin

How do I fix this problem?

Thanks
Link to comment
Share on other sites

As far as question 1 is concerned. I don't know. I don't like compiling and installing anything from source to the standard locations. That includes "/usr/local". I usually use another prefix, for example "/opt/php-version".

I'm not usually comfortable telling anyone where to install anything from source because installing in non default/standard locations has its own disadvantages if you don't know certain things (not that I'm an expert) and installing in the default locations, also has disadvantages/problems IMO.

I assume from your post that your original installation is from a binary package. I'd recommend that you try to find an update from your distro.

You might want to try a linux forum for general opinions on installing from source. Especially over binary packages.

question 2) I don't have experience compiling PHP with JAVA support but a look in the configure script shows the following.
[code]
if test -x $PHP_JAVA/bin/jar; then
    JAVA_JAR="$PHP_JAVA/bin/jar cf"
else
    { echo "configure: error: Unable to locate $PHP_JAVA/bin" 1>&2; exit 1; }
fi
[/code]

Another section below that looks for "javac". You need to find out where the JDK base installation directory is.
[quote=./configure --help]
--with-java[=DIR]      Include Java support. DIR is the JDK base install directory.
[/quote]
The symlink points to the /usr/local/jre1.5.0_01/ which seems to only be the JRE.

Do a
[code]
locate -r '/javac$'
[/code]
Use the directory you find it in as the argument to configure "./configure --with-java=/dir/path/".

If you see "javac" and "jar" in "/usr/local/jre1.5.0_01/bin/" then try using "--with-java=/usr/local/jre1.5.0_01" to avoid the symlink all together.
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.