Hello and welcome to our community! Is this your first visit?
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    Jan 2006
    Thanked 0 Times in 0 Posts

    Setting up the Java-PHP bridge.....OMG please help!

    Hi there,

    I have been trying to set up the Java-PHP bridge all day. I have had some success, as some examples work. However, others just spit out an error along the lines of Java class cannot be found.

    For example, this works fine:

    PHP Code:

    out.println ("hello from the servlet <br>");

    javax.script.ScriptEngine e = 
      php.java.script.EngineFactory.getPhpScriptEngine (this, 
    e.getContext().setWriter (out);
    e.eval (
        "<?php "+
    require_once ($_SERVER['DOCUMENT_ROOT'].'/java/Java.inc');" +
    $ctx java_context();" +
    echo 'hello from PHP '.$ctx.'<br>\n'"+

    Does that mean I've set it up successfully?

    I guess in-order to answer that you need to know what I've done

    Downloaded and installed JDK 1.6.0_07
    Downloaded and installed Apache TomCat 6.0.16
    Started Apache Tomcat
    Downloaded PHP-Java Bridge 5.2.2

    Then followed this instruction from http://php-java-bridge.sourceforge.net/doc/faq.php:

    Just copy JavaBridge.war to the Tomcat (or J2EE-) webapps directory, wait a second until the directory JavaBridge/ appears, then copy the JavaBridge directory over to your Apache or IIS document root.

    Unfortunately, I need help with the last part.......copying the JavaBridge Directory over to the Apache root folder. Which version of apache do I need. I installed the HTTP 2.2 server, but I am clueless of how to set it up. Also why is that last step needed?

    I am just trying to test all this locally on my PC for the moment.

    Do I need to install J2EE? I just feel like i've missed something out here.

    I read guides on hiveminds.co.uk:


    and here:

    They confused me though. I've tried both ways and the only thing that works is how I installed the software as decsribed above.

    Can anyone give me a comprehensive guide on how to do this properly?? The others are quite hard to follow, and when you get errors they don't explain how to get around them.

    I would like to be able to create a java script, compile it and then use PHP to grab it and show the results. Something just as simple as hello world! Not asking for much lol.

    any help would be cool.
    Last edited by jpmad4it; 07-29-2008 at 04:19 PM.

  2. #2
    New to the CF scene
    Join Date
    Aug 2008
    Thanked 0 Times in 0 Posts
    You may use this

  3. #3
    New Coder
    Join Date
    Jan 2006
    Thanked 0 Times in 0 Posts
    Cool thank you, I will look into this.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts