Running Java in PHP

From: Date: Wed, 03 Jul 2002 15:37:07 +0000
Subject: Running Java in PHP
Groups: php.lang 
Request: Send a blank email to php-lang+get-325@lists.php.net to get a copy of this message
Hi, I'm really new to Java in PHP, and curious to this great features. Q: How do I convert the code below so that it can run within PHP? =============================================================== import com.my.sm.api.*; import com.my.sm.api.interfaces.*; public class my1 { public static void main(String args[]) { if (args.length != 3) { System.err.println("Usage : java my1 <server> <username> <password>"); return; } System.out.println("Starting Engine.."); String server = args[0]; String username = args[1]; String password = args[2]; ApiSession session = null; try { session = ApiSession.openSession(server, username, password); } catch (RuntimeException e) { System.out.println(e.getMessage()); return; } } } ===================================================== FYI, I'm using PHP 4.2.1 with Java extension and JDK1.3. Thanks. --idaham

« previous php.lang (#325) next »