tags:

views:

9

answers:

0
import java.util.Currency;
 class xx {
     public static void main(String ... args) {
            System.out.println(Currency.getInstance("USD").getCurrencyCode());
     }
}

Compiled with

$ gcj-4 xx.java --main=xx -o xx.exe

cannot be run under Cygwin. Currency's class-initializer needs a property file that was included in the original jar, but which gcj didn't pack into the executable.

I wouldn't mind so much, but any kind of Formatter (Number, Date, &c) tries to initialize the class.

I've spent the day trying every combination of gcc options except the right one. If someone can post the (tested) solution, I'd be grateful past measure.