This question already has answers here:
Closed 11 years ago.
Possible Duplicate:
Call Java method from PHP5
How can I call a java application from a php application, taking note that they reside on the same server?
No WebServices or any http stuff.
Can I do that and how can I do it?
You can use php's exec(...) function to call java on the command line.
Related
This question already has answers here:
How to consume REST in Java [duplicate]
(11 answers)
Closed 8 years ago.
Now I am forming the URL in the browser, and execute it via REST api like
localhost:9043/api/json?apiKey=699cccc3dcfb348fd369e083bcd7f2a4&Severity=all
and will get some JSON Object output.
Instead of working on browser, I need to give the URL in the java code itself and to get the json object output also in java code itself. I have searched but not found yet. Need some experts answer for my question.
it's just an HTTP call like any other, so you call it like any other HTTP call from a Java application, and get the results from that call like that as well.
So look up HttpURLConnection and go from there.
This question already has answers here:
How do I add a Java backend to an existing PHP site without adding a tomcat server for Java Bridge?
(4 answers)
Closed 9 years ago.
I have created a program but i need to get a java program to run a php script with some arguments and then get the php script to send some arguments to the Java program. I know this question has been asked a lot of times but it seems like the only answer i can get is that php can do this but java cant but there must be a way to do it. Right?
You can run PHP from the command line:
http://php.net/manual/en/features.commandline.php
This should enable your Java application to run it, and capture it's return values.
This question already exists:
Can I use a api written in C with java web service [duplicate]
Closed 9 years ago.
I have a tool kit which is written in C. I want to make a java web service which will use this toolkit. how can I do that. how can I call the functions of this toolkit
If the toolkit gives outputs, can you just take the outputs and pipe them?
If not, I think it'd just be easier to convert it yourself, unless pointers are involved.
Otherwise,
http://java.sun.com/docs/books/jni/html/start.html#769
This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
how to call java function from c++?
Can C++ call Java code?
I have a native application on Linux (i.e. main() is in C++) and I want to reuse some of my Java code.
Can I load JVM libraries and somehow call Java classes?
Thank you!
You can load the JVM in your native application and invoke stuff using the Invocation API
This question already has answers here:
How Do I Eject a Volume in Java?
(2 answers)
Closed 3 years ago.
Is there any simple way to eject the D drive in Windows 7 using Java? I don't particularly care about cross-platform compatibility at the moment. I've done some research andRuntime.getRuntime().exec(); has shown up most... but I have no idea what to put as the string parameter, I've tried a few things but it just throws up on me!
You can pass the vbscript code to eject the cd as an argument in the exec() function.