I'm programming a homepage and I need to connect to JAVA and send some encrypted information to java and getting some back. How should I do this?
Asked
Active
Viewed 821 times
-4
-
you need to connect to JAVA?? That doesnt make sense .. – cowls Dec 16 '12 at 13:46
-
what do you mean with "I need to connect to JAVA"? – Luca Dec 16 '12 at 13:46
3 Answers
2
Just give you an idea
- compile and build your JAVA program, and your program should accept command line arguments as input and write output to STDOUT (i.e. write to
System.out
usingSystem.out.print
and such.) - Then, in PHP, use
exec()
to execute that jar file.

luiges90
- 4,493
- 2
- 28
- 43
-
-
I somehow assume that the OA knows output to STDOUT here means `System.out` >. – luiges90 Dec 16 '12 at 13:50
-
Yeah, but that you and I do know that doesn't necessarily mean every beginning or amateur programmer who reads this knows that. – 11684 Dec 16 '12 at 13:52
-
-
0
Disclaimer: I assume you mean that you want to connect a PHP or Java Website to a PHP or Java Server.
Usually when to alien systems have to communicate to each other in a web context - "webservices" come in play. There you can use a SSL encrypted connection to send and receive messages/data.
The two Buzzwords you can investigate reading are REST
and SOAP
.
http://stackoverflow.com/questions/209905/rest-and-soap

madflow
- 7,718
- 3
- 39
- 54