Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

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

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice