|
Posted by Colin McKinnon on 11/14/17 11:46
sylsau wrote:
> Hello,
>
> I wrote a JAVA program which uses the JAVA API JDOM 1.0 (of this site
> www.jdom.org)
> I put the archive jdom.jar in the directory /usr/share/java/jdom.jar
> and I added this path in the CLASSPATH variable.
> The program runs normally when I launch it in a unix shell.
>
> Now, I want to launch this JAVA program in a PHP program with system()
> function for example. I have an Apache server with PHP 4 who runs. The
> variable safe_mode of PHP is at off. So, the program PHP can launch
> executable program.
>
<snip>
> On my computer, Apache runs on the user www-data. And i tried to
> execute my program JAVA on this user and it runs normally. Besides, the
> CLASSPATH of the user www-data contain the path to jdom.jar
>
> This is the error message (contained in the file test.txt) after the
> execution of the PHP program :
>
> test
> Step 1
> FAILED
> java.lang.NoClassDefFoundError: org/jdom/input/SAXBuilder
> at Test.main(Test.java:51)
>
So check the CLASSPATH environment variable from within PHP. If its not
there. set it before running your java prog.
C.
Navigation:
[Reply to this message]
|