Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2575
  • Last Modified:

Calling java class through PHP

Hi, i have a java class ..ie: runApplet.java and once built, runApplet.class
I also have a website where the user presses the start button and the applet is supposed to run...
however i cannot figure out a way, in PHP, to actually call that java applet...
It works with HTML...but how do it in PHP??

Thanks...
0
Squadless
Asked:
Squadless
  • 3
  • 2
  • 2
  • +1
1 Solution
 
anilandeCommented:
have a look at this

http://in.php.net/java
0
 
Mark GilbertSenior Performance EngineerCommented:
You may find the xajax project useful: www.xajaxproject.org
0
 
hernst42Commented:
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
SquadlessAuthor Commented:
so basically in other words i cannot call a java class by something like
some syntax statement (classname);

where the some syntax stmt would call the class to be executed??...
0
 
hernst42Commented:
No typcial not so easy.

The quest is why do youn want to run a JavaApplet on the Server if the applet is supposed to run in the Browser of the user?
0
 
SquadlessAuthor Commented:
What about lets say its not an Applet.
Lets say i have a Login button which when pressed has to execute java code that will authenticate and perform some other security features.
so i have a class "sec.java"..

i do not really wish to "integrate" php and java, i just want that class to be called and executed from the same path.
There is no simple way to do that?...or whats the best way without "integrating"
0
 
SquadlessAuthor Commented:
on some sites i see this...

<?php
// get instance of Java class java.lang.System in PHP
$system = new Java('java.lang.System');
...
...
...

would that be appropriate for me...i would put method calls in the constructor of the class being instanciated and then it would execture from there....does that sound good or..?
0
 
anilandeCommented:
if u just want to execute a java class with or without passing command line parameters then u can fire java compiler/inter.. using the exec command

the statement will be some thing likw this

$returnvalue=`<path_to_java_compiler>/java java.class`;
echo $returnvalue;

or

$cmd="<path_to_java_compiler>/java java.class";
exec($cmd, $returnvalue);
echo $returnvalue;

or

$cmd="<path_to_java_compiler>/java java.class";
system($cmd, $returnvalue);
echo $returnvalue;


and more...


anilande
0

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

  • 3
  • 2
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now