Link problem with gcj

Andrew Haley aph@pasanda.cygnus.co.uk
Fri Aug 20 06:51:00 GMT 1999


> Date: Fri, 20 Aug 1999 15:46:40 +0200
> From: "b.d. vrijkorte" <bd.vrijkorte@signaal.nl>
> 
> Hello,
> 
> when I compile a 'Hello world' java-program using gcj I get an ld error
> (see below).
> I have installed:
> - gcc 2.95.1
> - binutils 2.9.1.0.25
> - libstdc++-2.90.6
> - libgcj-2.95
> 
> A 'Hello world' program using gcc compiles and works correctly.
> 
> Who can tell me what's wrong? 

Unlike C, which can only have one function called main(), every Java
class can have a method main(), so You have to tell gcj which class to
start.  What you need is

gcj test.java --main=test

Andrew.


More information about the Java mailing list