Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

How can I embed a java programme in PHP file and what
changes have to be done in PHP.ini file?

Answer Posted / pankajbisane

There are two possible ways to bridge PHP and Java: you can
either integrate PHP into a Java Servlet environment, which
is the more stable and efficient solution, or integrate Java
support into PHP. The former is provided by a SAPI module
that interfaces with the Servlet server, the latter by this
Java extension.
The Java extension provides a simple and effective means for
creating and invoking methods on Java objects from PHP. The
JVM is created using JNI, and everything runs in-process.

Example Code:

getProperty('java.version') . ''; echo 'Java vendor=' .
$system->getProperty('java.vendor') . ''; echo 'OS=' .
$system->getProperty('os.name') . ' ' .
$system->getProperty('os.version') . ' on ' .
$system->getProperty('os.arch') . ' '; // java.util.Date
example $formatter = new Java('java.text.SimpleDateFormat',
"EEEE, MMMM dd, yyyy 'at' h:mm:ss a zzzz"); echo
$formatter->format(new Java('java.util.Date')); ?>

The behaviour of these functions is affected by settings in
php.ini.
Table 1. Java configuration options
Name
Default
Changeable
java.class.path
NULL
PHP_INI_ALL
Name Default Changeable
java.home
NULL
PHP_INI_ALL
java.library.path
NULL
PHP_INI_ALL
java.library
JAVALIB
PHP_INI_ALL

Is This Answer Correct ?    4 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the use of pear in php?

950


Explain the difference between $var and $$var?

911


What is the difference between "echo" and "print" in php?

878


What does the scope of variables means?

971


Is it possible to remove the html tags from data?

868


How does php isset work?

893


What are the types of variables in php?

1020


Which function will suitably replace 'x' if the size of a file needs to be checked? $Size=x(filename);

949


Write a php function to convert all null values to blank?

1272


What changes I have to do in php.ini file for file uploading?

1019


What is the goto statement useful for?

959


Tell me what is htaccess?

872


Php being an open source is there any support available to it?

1047


What is the difference between a session and cookies?

904


What are the Formatting and Printing Strings available in PHP?

1040