String(strBytes, "UTF-16LE"); thorws java.io.UnsupportedEncodingException

Andreas Grunewald gruni.ca@gmail.com
Sun Apr 17 17:24:00 GMT 2005


Ok now I was able to compile with 
  static {
    gnu.gcj.convert.Input_UnicodeLittle i_UL = new
gnu.gcj.convert.Input_UnicodeLittle();
  }

and actually was able to workaround this bug, eventhough I can not
compile the programm in standard JDK. anyway it's a workaround.
So after doing this I got the next exception:

java.io.UnsupportedEncodingException: UTF-16LE
(java.lang.ClassNotFoundException:
gnu.gcj.convert.Output_UnicodeLittle n
ot found in gnu.gcj.runtime.SystemClassLoader{urls=[file:.\],
parent=gnu.gcj.runtime.VMClassLoader{urls=[core:/], parent
=null}})

All right I thought thinking logically I should have been able to do
  static {
    gnu.gcj.convert.Output_UnicodeLittle i_UL = new
gnu.gcj.convert.Output_UnicodeLittle
  }

But after looking into the libgcj.jar I saw that there is just a 
gnu.gcj.convert.Output_UnicodeLittleUnmarked but no 
gnu.gcj.convert.Output_UnicodeLittle

so I'm just three codelines further in compiling a perfect Java
programm with GCJ.
It's quite frustrating having to work with System.out.println() to
debug a big project to find where the Exceptions occure and then
trying to find out how to solve the compiler problem.

Regards,

Andreas

2005/4/17, Andrew Haley <aph@redhat.com>:
> Andreas Grunewald writes:
>  > 2005/4/17, Andrew Haley <aph@redhat.com>:
>  > > Andreas Grunewald writes:
>  > >  > Ok once again a new something that I detected.
>  > >
>  > > It's a problem with static linking.
>  > But the GCJ 4.0 for windows only supports static linking.
> 
> Right, and that is why it doesn't work.  In general, the Java API
> doesn't work with static linking, because classes are referred to by
> name and looked up at runtime.  The way you can fix this is to
> determine which classes are needed by your application and link them
> into your executable.
> 
> Andrew.
>



More information about the Java mailing list