os.arch and os.name is incorrect

Øyvind Harboe oyvind.harboe@zylin.com
Sat Feb 15 17:37:00 GMT 2003

I'm compiling my SWT app using GCJ, and I discovered that os.arch 
and os.name are different than expected. 

Strangely I haven't noticed too many adverse effects of this. SWT seems
to cope reasonably well(except that it searches for motif libraries and
what not, which I saw using http://www.sysinternals.com filemon.exe).

Perhaps this is already fixed... My GCJ superpowers are limited 
to downloading and running MinGW.

Java code:

   String os = System.getProperty("os.name");
   String arch = System.getProperty("os.arch");
   System.out.println("Native binaries for \"" + os + 
                      "\" \"" + arch + "\" native libraries ..");


- JDK 1.4.1: "Native binaries for  "Windows 2000" "x86" native libraries .."

- GCJ: "Native binaries for  "Windows 2000" "i586" native libraries .."

- Try compiling with gcj -Os and it's even more wrong(I've filed a bug report,
can't remember what it prints out in that case).



gcj -v

Reading specs from c:/mingw/bin/../lib/gcc-lib/mingw32/3.2/specs
Reading specs from c:/mingw/bin/../lib/gcc-lib/mingw32/3.2/../../../libgcj.spec
rename spec lib to liborig
Configured with: /extra/src/gcc/gcc-3.2/configure --prefix=/extra/wingcc --build
=i686-pc-linux-gnu --host=mingw32 --target=mingw32 --enable-languages=c,c++,java
 --with-gcc --with-gnu-as --with-gnu-ld --with-as=/extra/xgcc/bin/mingw32-as --w
ith-ld=/extra/xgcc/bin/mingw32-ld --enable-threads=win32 --disable-nls --disable
-win32-registry --disable-shared --disable-debug --disable-multilib --without-ne
wlib --enable-libgcj --disable-java-awt --without-x --enable-java-gc=boehm --dis
able-libgcj-debug --enable-interpreter --enable-hash-synchronization
Thread model: win32
gcc version 3.2 (mingw special 20020817-1)

More information about the Java mailing list