Hello, i have been following the Eclipse Java Tutorial and it has been very enlightening but now i am in a quandary. In tutorial 9, it instructs that i enter 'ArrayList<String> list = new ArrayList<String>();' i did this and it just does not work the same way as it appears in the video. i then have to remove the <String> for me to continue. this puzzles me.
Can anyone please explain why this is the case for me?
Thanks
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello. Can you please check what version of the JRE you are running? One possible explanation is that you are running version 1.4 and not 1.5. You can tell this by opening Eclipse and selecting Window / Preferences / Java / Installed JRE's. The JRE version should be 1.5 or 1.6. Java Generics, which this example uses, were introduced in Java 1.5.
Please let me know what you find. Thanks. Mark
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I had the same problem even though I have java 1.6 installed. But I solved the problem by changing compiler compliance level to 6. It can be found in Window > Preferences > Java > Compiler.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello, i have been following the Eclipse Java Tutorial and it has been very enlightening but now i am in a quandary. In tutorial 9, it instructs that i enter 'ArrayList<String> list = new ArrayList<String>();' i did this and it just does not work the same way as it appears in the video. i then have to remove the <String> for me to continue. this puzzles me.
Can anyone please explain why this is the case for me?
Thanks
Hello. Can you please check what version of the JRE you are running? One possible explanation is that you are running version 1.4 and not 1.5. You can tell this by opening Eclipse and selecting Window / Preferences / Java / Installed JRE's. The JRE version should be 1.5 or 1.6. Java Generics, which this example uses, were introduced in Java 1.5.
Please let me know what you find. Thanks. Mark
I had the same problem even though I have java 1.6 installed. But I solved the problem by changing compiler compliance level to 6. It can be found in Window > Preferences > Java > Compiler.