This is the mail archive of the java@gcc.gnu.org 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]
Other format: [Raw text]

Compiling resources with --resource


Hello,

I almost got my java app working under gcj, but I have been having
trouble understanding why I can't compile my resource files into my app.
I'm using gcj version 3.1 (20020713). I've created a sample file that
should work, but having no success (I'm trying to incorporate the
resource file from the gnu.getopt library). Here is the test file:


import java.util.*;

public class test {
   public static void main( String args[] ) {
      try {
         ResourceBundle res = ResourceBundle.getBundle(
"gnu/getopt/MessagesBundle",
                             Locale.getDefault() );
         System.err.println( "HERE: " + res.getString(
"getopt.ambigious" ) );
      } catch( Exception e ) {
         System.err.println( e.toString() );
      }
   }
}

I compile it with the following 2 commands:

gcj -c --resource gnu/getopt/MessagesBundle
gnu/getopt/MessagesBundle.properties -o gnu.getopt.MessagesBundle.o

gcj -o test --main=test test.java gnu.getopt.MessagesBundle.o

But when I delete the gnu/getopt/MessagesBundle.properties file and run
./test, I get the error:

java.util.MissingResourceException: Bundle gnu/getopt/MessagesBundle not
found

So why isn't it able to find the compiled-in resource?

Any help would be greatly appreciated.
David
(dreiss@yahoo.com)


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