|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2004-02-04 19:10 UTC] sniper@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Nov 04 20:00:01 2025 UTC |
Description: ------------ 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 extension=php_java.dll [java] 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: --------------- //SalesTax.java 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