This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
package declaration
- To: "Mohammad O'mara" <momara at iti-idsc dot gov dot eg>
- Subject: package declaration
- From: Andrew Haley <aph at cambridge dot redhat dot com>
- Date: Mon, 9 Jul 2001 18:23:02 +0100 (BST)
- Cc: <java at gcc dot gnu dot org>
- References: <004701c1089a$ca38a420$1e01000a@ellipsisdigital.com>
Mohammad O'mara writes:
> I wanted to generate an executable file for my application , so I
> generated the object files successfully.
Right.
> But when linking them it gave me strange errors moving me to 2
> files under /temp and I didn't find these files !
What strange errors where these?
> .. I tried many things to debug my source code
Compiling with `-g' and then using gdb is usally the Right Thing to
do.
>. and by accident I doubted the package declaration , which is very
>normal for example when dealing with JDK .. package packagename;
>... and I deleted this line from my source code .. and it worked
>like that generating the exe file !
Well, let me try.
z.java: -----------------------------------------------------------
package foo;
class z
{
public static void main (String argv[])
{
System.out.println ("Hello");
}
}
------------------------------------------------------------------
Then:
> gcj z.java --main=foo.z
> ./a.out
Hello
>
Looks good to me.
Andrew.