|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #27151 Warning: java.lang.ClassNotFoundException
Submitted: 2004-02-04 14:18 UTC Modified: 2004-02-04 19:10 UTC
From: genius_cse at yahoo dot com Assigned:
Status: Not a bug Package: Java related
PHP Version: 4.3.4 OS: Windows XP SP1
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
42 - 30 = ?
Subscribe to this entry?

 [2004-02-04 14:18 UTC] genius_cse at yahoo dot com
I am using:
PHP 4.3.4, J2SDK1.4.2_01, Apache 1.3 with CGI Module

Current php.ini configuration:
extension_dir = c:\php\extensions

java.class.path = "c:\php\extensions\php_java.jar; c:\myclasses\"
java.home = c:\j2sdk1.4.2_01\bin
java.library = c:\j2sdk1.4.2_01\jre\bin\server\jvm.dll
java.library.path = c:\php\extensions
- the above c:\myclasses\ as my custom java class directory.

Reproduce code:
import java.util.*;
import java.text.*;
public class SalesTax {
  public String SalesTax(double price, double salesTax) {
    double tax = price * salesTax;
    NumberFormat numberFormatter;
    numberFormatter = NumberFormat.getCurrencyInstance();
    String priceOut = numberFormatter.format(price);
    String taxOut = numberFormatter.format(tax);
    numberFormatter = NumberFormat.getPercentInstance();
    String salesTaxOut = numberFormatter.format(salesTax);
    String str = "A sales Tax of " + salesTaxOut +
                 " on " + priceOut + " equals " + taxOut + ".";
    return str;
in salestax.php calling :
$salesTax = new Java("SalesTax");
my SalesTax.class is in c:\classes as specified in java.class.path

Expected result:
Expected output will print out salesTaxOut, priceOut, taxOut values.

Actual result:
But i just got the following error message:
Warning: java.lang.ClassNotFoundException: SalesTax in c:\Program Files\Apache Group\Apache\htdocs\myclasses\SalesTaxInterface.php on line 21

Fatal error: Call to a member function on a non-object in c:\Program Files\Apache Group\Apache\htdocs\myclasses\SalesTaxInterface.php on line 28


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2004-02-04 19:10 UTC]
Please do not submit the same bug more than once. An existing
bug report already describes this very problem. Even if you feel
that your issue is somewhat different, the resolution is likely
to be the same. 

Thank you for your interest in PHP.

search the java/servlet related bug reports before you submit yet another report.

PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Jul 14 15:01:28 2024 UTC