Error in GCJ (redhat linux 9.0)

S

suprajapc

Hi All,
When we try to run the below program
public class fir
{
public static void main(Strings args[ ])
{
System.out.println("Hello World");
}
}

using the following command gcj fir.java
it is giving this error....

[root@localhost root]# gcj fir.java
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/../../../crt1.o(.text+0x18):
In functio
n `_start':../sysdeps/i386/elf/start.S:77: undefined reference to
`main'
collect2: ld returned 1 exit status

Waiting for the reply
Thank You
 
G

Gordon Beaton

[root@localhost root]# gcj fir.java
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/../../../crt1.o(.text+0x18):
In functio
n `_start':../sysdeps/i386/elf/start.S:77: undefined reference to
`main'
collect2: ld returned 1 exit status

Waiting for the reply

Your problem is described in section 4 of the GCJ FAQ:

http://gcc.gnu.org/java/faq.html

Why do you compile your code logged in as root?

/gordon
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,813
Latest member
lawrwtwinkle111

Latest Threads

Top