This is the mail archive of the java-discuss@sourceware.cygnus.com 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]

Re: My own problem with gcj



Joshua R. Poulson writes:
> Mine's worse. I have your code:
> 
>    public class Example {
>       public static void
>       main(String[] args)
>       {
>          System.out.println("Hello World");
>       }
> 
>    }
> 
> And I can compile a class file, and even a .o file, but for for an executable
> and I get this:
> 
> $ gcj Example.java

That's how you get the .o. If you want to link the executable, try:

$ gcj Example.java --main=Example

gcj needs to be told which class contain the `main'.

Alternatively, you can still get and .o and then link:

$ gcj -c Example.java
$ gcj Example.o --main=Example

./A

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