* Compiling Generics
@ 2009-03-11 17:48 Jacob Jennings
2009-03-11 17:52 ` Andrew John Hughes
2009-03-11 17:53 ` Andrew Haley
0 siblings, 2 replies; 6+ messages in thread
From: Jacob Jennings @ 2009-03-11 17:48 UTC (permalink / raw)
To: java
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
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Compiling Generics
2009-03-11 17:48 Compiling Generics Jacob Jennings
@ 2009-03-11 17:52 ` Andrew John Hughes
2009-03-11 17:53 ` Andrew Haley
1 sibling, 0 replies; 6+ messages in thread
From: Andrew John Hughes @ 2009-03-11 17:52 UTC (permalink / raw)
To: Jacob Jennings; +Cc: java
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
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Compiling Generics
2009-03-11 17:48 Compiling Generics Jacob Jennings
2009-03-11 17:52 ` Andrew John Hughes
@ 2009-03-11 17:53 ` Andrew Haley
2009-03-12 2:11 ` BGB
1 sibling, 1 reply; 6+ messages in thread
From: Andrew Haley @ 2009-03-11 17:53 UTC (permalink / raw)
To: Jacob Jennings; +Cc: java
Jacob Jennings wrote:
> 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".
I suspect you're just using an obsolete version of gcj. Generics have
worked for a year now, since gcj 4.3.0.
Andrew.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Compiling Generics
2009-03-11 17:53 ` Andrew Haley
@ 2009-03-12 2:11 ` BGB
2009-03-12 2:20 ` Glenn Chambers
0 siblings, 1 reply; 6+ messages in thread
From: BGB @ 2009-03-12 2:11 UTC (permalink / raw)
To: java
----- Original Message -----
From: "Andrew Haley" <aph@redhat.com>
To: "Jacob Jennings" <jdjennin@gmail.com>
Cc: <java@gcc.gnu.org>
Sent: Thursday, March 12, 2009 3:52 AM
Subject: Re: Compiling Generics
> Jacob Jennings wrote:
>> 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".
>
> I suspect you're just using an obsolete version of gcj. Generics have
> worked for a year now, since gcj 4.3.0.
>
except for those of us who use Cygwin or MinGW, where I think I installed a
newer MinGW not too long ago (back in January), and it is 3.4.5...
Cygwin was installed clean newer, and from what I remember, its version of
gcj is older...
but, all this is nothing new probably...
apps which use configure almost invariably fail to work as well.
invariably, they end up also depending on some library not present/working
(such as glib, which is by default absent on MinGW, and apparently broken on
Cygwin), or using some tool which is not present as part of the build
process (such as lex, yacc, or bison, or yet more obscure tools...), ...
but I guess all this just "comes with the territory" wrt building any
opensource apps on Windows...
or such...
> Andrew.
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Compiling Generics
2009-03-12 2:11 ` BGB
@ 2009-03-12 2:20 ` Glenn Chambers
2009-03-12 3:28 ` BGB
0 siblings, 1 reply; 6+ messages in thread
From: Glenn Chambers @ 2009-03-12 2:20 UTC (permalink / raw)
To: BGB; +Cc: java
On Thu, 2009-03-12 at 12:10 +1000, BGB wrote:
> ----- Original Message -----
> From: "Andrew Haley" <aph@redhat.com>
> > I suspect you're just using an obsolete version of gcj. Generics have
> > worked for a year now, since gcj 4.3.0.
> >
>
> except for those of us who use Cygwin or MinGW, where I think I installed a
> newer MinGW not too long ago (back in January), and it is 3.4.5...
>
> Cygwin was installed clean newer, and from what I remember, its version of
> gcj is older...
I don't have an install handy, but I believe Cygwin currently ships both
3.4 and 4.x versions of gcc.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Compiling Generics
2009-03-12 2:20 ` Glenn Chambers
@ 2009-03-12 3:28 ` BGB
0 siblings, 0 replies; 6+ messages in thread
From: BGB @ 2009-03-12 3:28 UTC (permalink / raw)
To: Glenn Chambers; +Cc: java
----- Original Message -----
From: "Glenn Chambers" <gchamber@bright.net>
To: "BGB" <cr88192@hotmail.com>
Cc: <java@gcc.gnu.org>
Sent: Thursday, March 12, 2009 12:20 PM
Subject: Re: Compiling Generics
> On Thu, 2009-03-12 at 12:10 +1000, BGB wrote:
>> ----- Original Message -----
>> From: "Andrew Haley" <aph@redhat.com>
>
>> > I suspect you're just using an obsolete version of gcj. Generics have
>> > worked for a year now, since gcj 4.3.0.
>> >
>>
>> except for those of us who use Cygwin or MinGW, where I think I installed
>> a
>> newer MinGW not too long ago (back in January), and it is 3.4.5...
>>
>> Cygwin was installed clean newer, and from what I remember, its version
>> of
>> gcj is older...
>
> I don't have an install handy, but I believe Cygwin currently ships both
> 3.4 and 4.x versions of gcc.
>
oh...
gcc/gcj 4.3.2 is available under gcc-4 and gcj-4...
I had failed to notice it...
the version message claims it is an alpha version though...
MinGW only has 3.4.5 though...
>
>
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2009-03-12 3:28 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-03-11 17:48 Compiling Generics Jacob Jennings
2009-03-11 17:52 ` Andrew John Hughes
2009-03-11 17:53 ` Andrew Haley
2009-03-12 2:11 ` BGB
2009-03-12 2:20 ` Glenn Chambers
2009-03-12 3:28 ` BGB
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).