Help using -I

Ryan Boder icanoop@bitwiser.org
Wed Aug 6 01:30:00 GMT 2003


Hi, I hate to ask dumb questions but I've never used gcj before. I can't get
-I to work.

I'm trying to compile a command line client for my jboss application with
gcj. I thought I'd spare you all the details, so here is a little program
that has the same problem I am having with my jboss client. Why does it say
there are undefined references, when the classes are obviously there? It
works fine when I don't use -I. Does -I work at all?

I put the program in a patch because I realize some mailing lists don't like
attachments. Here is the patch. To apply it change into an empty directory
and do 'cat patchfile | patch -p1'.


------------------------- BEGIN PATCH --------------------------------------

diff -urN temp/bob/Bob.java gcj-test/bob/Bob.java
--- temp/bob/Bob.java	1969-12-31 19:00:00.000000000 -0500
+++ gcj-test/bob/Bob.java	2003-08-05 20:31:21.000000000 -0400
@@ -0,0 +1,16 @@
+package bob;
+
+
+
+
+public class Bob {
+
+    private int var;
+
+    public Bob() {
+        var = 10;
+    }
+
+    
+
+}
diff -urN temp/bob/Main.java gcj-test/bob/Main.java
--- temp/bob/Main.java	1969-12-31 19:00:00.000000000 -0500
+++ gcj-test/bob/Main.java	2003-08-05 21:09:28.000000000 -0400
@@ -0,0 +1,17 @@
+package bob;
+
+import bob.Bob;
+
+
+
+public class Main {
+
+    public static void main(String[] args) {
+        
+        Bob bob = new Bob();
+
+        System.out.println("It worked");
+    }
+    
+
+}
diff -urN temp/Makefile gcj-test/Makefile
--- temp/Makefile	1969-12-31 19:00:00.000000000 -0500
+++ gcj-test/Makefile	2003-08-05 21:10:26.000000000 -0400
@@ -0,0 +1,10 @@
+
+
+main:	bob/Main.java	bob/Bob.java
+	javac bob/Bob.java
+	jar cvf bob.jar bob/Bob.class
+	gcj --main=bob.Main -I bob.jar -o $@ $<
+
+
+clean:	
+	rm -f main bob.jar bob/*.class *~ bob/*~

------------------------- END PATCH -------------------------------------- 



More information about the Java mailing list