The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Php with Java

Discussion in 'General Discussion' started by jacks, Mar 10, 2005.

  1. jacks

    jacks Active Member

    Nov 15, 2004
    Likes Received:
    Trophy Points:

    Using the WHM, I compiled Apache with Php and Java module, but every time I run my php script I get the following error message:

    Fatal error: Cannot instantiate non-existent class: java in /home/domaint/public_html/phpjava_test.php on line 3

    Here is a copy of the php script I used for testing:

      // get instance of Java class java.lang.System in PHP
      $system = new Java('java.lang.System');
      // demonstrate property access
      print 'Java version='.$system->getProperty('java.version').' <br>';
      print 'Java vendor=' .$system->getProperty('java.vendor').'  <br>';
      print 'OS='.$system->getProperty('').' '.
                  $system->getProperty('os.version').' on '.
                  $system->getProperty('os.arch').' <br>';
      // java.util.Date example                      
      $formatter = new Java('java.text.SimpleDateFormat',
                            "EEEE, MMMM dd, yyyy 'at' h:mm:ss a zzzz");
      print $formatter->format(new Java('java.util.Date'));
    Any body can help solving this error message?

    Thanks and appreciate the help.
    #1 jacks, Mar 10, 2005
    Last edited: Mar 10, 2005

Share This Page