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: Compiling Generics


2009/3/11 Jacob Jennings <jdjennin@gmail.com>:
> Hello, everyone. I just began using GCJ a short time ago, and I've
> just run into a bit of a problem--most likely stemming from my lack of
> knowledge about this compiler. In my Data Structures class, we program
> a lot using generics, and I'd love to use GCJ, but when I attempt to
> compile
>
> public class ListNode<E> {
> ...
> // blah blah, data members, constructors, methods, etc.
> }
>
> I get this error message:
>
> ListNode.java:1: error: '{' expected.
> public class ListNode<E> {
> Â Â Â Â Â Â Â Â Â Â Â Â^
> ListNode.java:1: confused by earlier errors, bailing out
>
> Now when I compile this same code into bytecode with the Sun SDK, then
> compile the bytecode into machine code using GCJ, the compilation
> succeeds, and the resulting binary works perfectly fine. I would like
> to get away from using Sun's SDK unless I'm doing GUI programming. Is
> there a compile-time flag I'm missing or something? The command I'm
> trying to execute is "gcj -o LinkedQueue --main=LinkedQueue
> ListNode.java Queue.java LinkedQueue.java". Thank you.
>
> Jacob D. Jennings
>

What version of gcj are you using?
-- 
Andrew :-)

Free Java Software Engineer
Red Hat, Inc. (http://www.redhat.com)

Support Free Java!
Contribute to GNU Classpath and the OpenJDK
http://www.gnu.org/software/classpath
http://openjdk.java.net

PGP Key: 94EFD9D8 (http://subkeys.pgp.net)
Fingerprint: F8EF F1EA 401E 2E60 15FA  7927 142C 2591 94EF D9D8


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