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: copile java 1.5 code


On Wed, 2005-01-26 at 14:26, Michael Koch wrote:
> Am Mittwoch, 26. Januar 2005 15:13 schrieb Tim Oliver Wagner:
> > Hello,
> > I need to compile a java program. This one is written with java
> > 1.5. It does not work to compile the program correct.
> >
> > I wrote a little program to solve my compile problems, but it still
> > doesn't work. I hope someone can help me. Or is it just at the
> > moment not possible to compile java 1.5 code?
> >
> > The little senseless program is append to this mail.
> 
> java.lang.StringBuilder was added in JDK 1.5 and we don't added that 
> to GCJ yet.
> 
> 
> Michael 

The class Test.java uses a parametrically-typed list (List<String>) and
so will not compile with gcj or any other pre-1.5 compiler (including
previous versions of Sun's compiler).  It will compile with javac or ecj
(including against the generics branch of GNU Classpath).

As for running the class, Test.class works just fine, including with gcj
3.4.  Test2 uses the concatenation operator, '+', which requires the
existence of java.lang.StringBuilder, as 1.5 compilers use this new
class to perform this operation.  This is in GNU Classpath, so you can
either wait for it to be merged to gcj, or, alternatively, alter the
class to perform concatenation differently (for example, explicitly
using java.lang.StringBuffer).  
-- 
Andrew :-)

Please avoid sending me Microsoft Office (e.g. Word, PowerPoint) attachments.
See http://www.fsf.org/philosophy/no-word-attachments.html

No software patents in Europe -- http://nosoftwarepatents.com

"Value your freedom, or you will lose it, teaches history.
`Don't bother us with politics' respond those who don't want to learn."
-- Richard Stallman

"We've all been part of the biggest beta test the world has ever known --
Windows"
-- Victor Wheatman, Gartner

Attachment: signature.asc
Description: This is a digitally signed message part


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