This is the mail archive of the java@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RMI test of GCJ


RMI seems to work w/GCJ, with a small snag(described below).
 
The GCJ hello world app  below is 600k zipped. Neat.

- I ran trough the java.sun.com/rmi getting started tutorial. 
- Modified the applet to the code below(i.e. a console version instead of applet).
- It ran and exited fine jusing java.exe
- When I compiled it with GCJ and ran it, it never terminated(modified it to do so below).
\thisiscool-gcc\gcc-3.3\bin\gcj -Os -s --main=examples.hello.HelloConsole -o hello.exe  examples\hello\HelloConsole.class examples\hello\Hello.class

I'm not sure if this is cause for alarm.

package examples.hello;
import java.rmi.Naming;
public class HelloConsole
{
String message = "blank"; 
// "obj" is the identifier that we'll use to refer 
// to the remote object that implements the "Hello" 
// interface 
Hello obj = null; 
public static void main(String[] args)
{
new HelloConsole().run();
}
/**
* 
*/
private void run()
{
try { 
obj = (Hello)Naming.lookup("//lair/HelloServer"); 
message = obj.sayHello(1);
System.out.println("Hello " + message);
System.exit(0); // the program does not terminate, if I do not add this line
} catch (Exception e) { 
System.out.println("HelloConsole exception: " + e.getMessage()); 
e.printStackTrace(); 
} 
}
}


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]