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]

Re: How to overcome MissingResourceException (gnu.java.locale.Calendar)


Martin Egholm Nielsen wrote:

Martin> // private static Class _c = gnu.java.locale.Calendar.class;

Well, the final target will be a PPC405 running Linux, but in the transition phase between using IBM's J9 and GCJ, I'm compiling on Windows/Cygwin... But maybe that's not a good idea...




Why don't you try something like this:

private static Class _c = System.getProperty("java.vendor","").equals("Free Software Foundation, Inc.") ? gnu.java.locale.Calendar.class : null;

You will have to include libgcj-<x.y.z>.jar in classpath when compiling to bytecode. But the bytecode should run fine, using a Standard JVM, without that jar in its classpath.

At least I have tested it with the folloing class, and it worked:

public class TestClass {

private static Class _c = System.getProperty(
"java.vendor","").equals("Free Software Foundation, Inc.") ? gnu.java.locale.Calendar.class : null;

public static void main(String[] args) {
Date date=new Date();
System.out.println(Integer.toString(1900+date.getYear()));
}
}


The bytecode test was made, using Sun's JVM, like this:
java -classpath . TestClass

libgcj-<x.y.z>.jar was not in current directory, and it was not in the Sun's stuff, so I think it is safe to say that it was not in the classpath.

I hope this helps...


Regards,


Joao




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