Skip to main content



      Home
Home » Newcomers » Newcomers » J2SE 5.0 - generic types
J2SE 5.0 - generic types [message #13179] Sun, 23 January 2005 12:01 Go to next message
Eclipse UserFriend
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 #13207 is a reply to message #13179] Sun, 23 January 2005 12:23 Go to previous messageGo to next message
Eclipse UserFriend
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? :)
>
>
>
Re: J2SE 5.0 - generic types [message #21714 is a reply to message #13207] Mon, 31 January 2005 15:44 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: rossetti.uark.edu

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? :)
>>
>>
>>
Re: J2SE 5.0 - generic types [message #21803 is a reply to message #21714] Mon, 31 January 2005 16:04 Go to previous message
Eclipse UserFriend
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? :)
>>>
>>>
>>>
>
>
Previous Topic:Eclipse does not start - ExceptionInInitializerError
Next Topic:How do I install plugins ?
Goto Forum:
  


Current Time: Wed Apr 16 03:56:39 EDT 2025

Powered by FUDForum. Page generated in 0.05041 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top