Compiling resources with --resource

dreiss dreiss@yahoo.com
Fri Jul 19 18:12:00 GMT 2002


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)


More information about the Java mailing list

AltStyle によって変換されたページ (->オリジナル) /