J2SE 5.0 - generic types [message #13179] |
Sun, 23 January 2005 12:01  |
Eclipse User |
|
|
|
Originally posted by: grape94.hotmail.com
Hi
I want to use generic types, for example:
ArrayList<Integer> list = new ArrayList<Integer>();
I am using eclipse 3.0.1, but it gives a syntax error and I am therefore
unable to compile.
Is it impossible to use generic types (and the other features unique to
J2SE 5.0) in eclipse or is there something I am missing? :)
|
|
|
|
|
Re: J2SE 5.0 - generic types [message #21803 is a reply to message #21714] |
Mon, 31 January 2005 16:04  |
Eclipse User |
|
|
|
yes you will have the same error unless you move to Eclipse 3.1 (m4)
Eclipse has its own compiler that is just completing 5.0 support now.
HTH
Darins
"Manuel" <rossetti@uark.edu> wrote in message
news:ctm5bj$dtk$1@www.eclipse.org...
> Darin,
>
> I'm having the same problem. I'm using Eclipse Version: 3.0.1
> Build id: 200409161125 and I get syntax errors with a simple program like:
>
> public class TestGenerics {
>
> public static void main(String[] args) {
> List<String> list = new LinkedList<String>();
> list.add("A");
> list.add("B");
> list.add("C");
> System.out.println(list);
> }
> }
>
>
> Exception in thread "main" java.lang.Error: Unresolved compilation
> problems: Syntax error on token "<", invalid AssignmentOperator
> Syntax error on token "=", != expected
> Syntax error on token "<", ( expected
> Syntax error on token "(", invalid Expression
>
> at
> jsl.modeling.elements.processview.description.TestGenerics.m ain(TestGenerics.java:20)
>
> I don't know how to get Eclipse to recognize the 1.5 features. I have
> java.runtime.name=Java(TM) 2 Runtime Environment, Standard Edition
> java.runtime.version=1.5.0_01-b08
>
> Did moving to Eclipse 3.1 M4 fix your problem?
>
> Manuel
>
> Darin Swanson wrote:
>
>> Eclipse 3.0.1 does not support 5.0.
>> Try Eclipse 3.1 M4 for the latest 5.0 support.
>
>> Darins
>
>> "Juliet" <grape94@hotmail.com> wrote in message
>> news:ct0l99$bt1$1@www.eclipse.org...
>>> Hi
>>>
>>> I want to use generic types, for example:
>>> ArrayList<Integer> list = new ArrayList<Integer>();
>>>
>>> I am using eclipse 3.0.1, but it gives a syntax error and I am therefore
>>> unable to compile.
>>>
>>> Is it impossible to use generic types (and the other features unique to
>>> J2SE 5.0) in eclipse or is there something I am missing? :)
>>>
>>>
>>>
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.05041 seconds