cancel
Showing results for 
Search instead for 
Did you mean: 

Error to the past in the Eclipse - List tags = Arrays.asList("Hello", "Tutorial"); in

Former Member
0 Kudos

Hi,

When I past the Setting properties List<String> tags = Arrays.asList("Hello", "Tutorial"); in the Eclipse I have this error:

The type List is not generic; it cannot be parameterized with arguments <String>            HelloWorldServlet.java      /hello-world/src/com/sap/cloud/sample/helloworld      line 98           Java Problem

Why?

Weides

Accepted Solutions (1)

Accepted Solutions (1)

gregory_cm
Explorer
0 Kudos

Hi Weides...

Maybe, accidently, when you first hit "organize imports" after you pasted that code fragment, and you were asked which "List" you want to import most probably you selected java.awt.List (In java you have at least the awt list and the java.util.List)

Now... do the following:

1. Delete the import statement of import java.awt.List and delete the import java.util.List

2. Put back List<String>

3. Then, Organize Imports again , and when it prompted for the choice, choose java.util.List.

I hope that works for you.

Regards.

(PD. Useful checks will be appreciated)

Former Member
0 Kudos

Thank you for help! You wore correct.

I didn't have imported the java.util.List..

Sds

Weides

Answers (1)

Answers (1)

Vlado
Advisor
Advisor
0 Kudos

Looks like you have imported the wrong List class. Ensure that it is java.util.List.

Cheers,

--Vlado