php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #19327 java.lang.UnsatisfiedLinkError: no php_java in java.library.path
Submitted: 2002-09-10 02:37 UTC Modified: 2003-08-08 06:17 UTC
Votes:19
Avg. Score:4.1 ± 0.9
Reproduced:16 of 16 (100.0%)
Same Version:2 (12.5%)
Same OS:4 (25.0%)
From: chregu@php.net Assigned:
Status: No Feedback Package: Java related
PHP Version: 4CVS-2002-09-10 OS: linux debian
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2002-09-10 02:37 UTC] chregu@php.net
A simple java test-script gives me the following error:

java.lang.UnsatisfiedLinkError: no php_java in java.library.path 

when i make a symbolic link from

$extensiondir$/java.so to $extensiondir$/libphp_java.so

it works.

Didn't find a quick solution for solving that problem.

chregu


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-09-10 03:20 UTC] chregu@php.net
I looked a little bit at the code

php_java.jar tries to load the external library 
libphp_java.so in reflect.java with:
 System.loadLibrary(bundle.getString("library"));

library is defined in Makefile.frag ) as
    @echo library=php_java > $(srcdir)/net/php/reflect.properties

but we can't change php_java to just java, because then we get conflicts with the main libjava.so. furthermore System.loadLibrary prepends "lib" before the library name, and searches for this name (libphp_java.so in this example).
I didn't find a solution to tell java to look for just php_java.so ...

Does anyone know a solution to this problem?

chregu



 [2002-10-31 11:52 UTC] iliaa@php.net
Did you setup the ini settings that tell the java.so where to look for javalibs & classes?
 [2002-10-31 12:02 UTC] chregu@php.net
yep, the java-extension works on my system, but only when i make this symlink.

chregu
 [2003-08-08 06:17 UTC] sniper@php.net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Open". Thank you.


 [2004-05-26 19:16 UTC] aamir at signalcommunications dot com dot au
i did exprience similar problem , going by what was said here  I understood what the problem was to fix it  , i copyed php_java.dll to 
"c:\jdk\jre\bin" folder and  it was fixed , 
i am running php under winXP , IIS 5 

regards
Aamir
 [2006-06-08 22:04 UTC] test at aol dot com
That almost worked for me but apache 2.0.54 on windows xp was crashing. (php 4.4)

Solution:

make sure these lines are in your php.ini.  The most important one is having java.library.path set to your extensions directory

[Java]
java.class.path = "C:\PHP4\extensions\php_java.jar"
java.home = "C:\Program Files\Java\jre1.5.0_06"
java.library = "C:\Program Files\Java\jre1.5.0_06\bin\client\jvm.dll" 
java.library.path = "C:\PHP4\extensions\"
 [2007-12-10 21:45 UTC] gio_y at hotmail dot com
sss
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 25 11:01:30 2024 UTC