Question:
Problems compiling java in Ubuntu?
Jorge M
2010-10-09 10:55:00 UTC
I am running Ubuntu 10.04 for the first time, and am having some issues compiling my java program. When I try to make an ArrayList of any type, it gives me the message:

"Syntax error, parameterized types are only available if source level is 1.5"

What does this mean, and how can I fix it? So far I haven't had any other compiling issues.
Three answers:
Silent
2010-10-09 11:07:05 UTC
It means you're trying to compile against an older version of Java that predates the addition of parameterized types to the language.



You need to make sure that you're compiling to the right version of the language. How exactly you do that depends on what exactly you're doing. Are you compiling using the command-line tools, or an IDE of some kind?
deonejuan
2010-10-09 11:27:43 UTC
If I were you, I would download the NetBeans / JDK bundle. Install that into your Home Folder as ~/NetBeans; ~/JDK1.6_2xx and make a folder for ~/NetBeans_projects.



NetBeans will database all the pathnames for the connectivity. It will also allow you to set the level of Java release.



Paramerterized types is like this

ArrayList salaried...

List list...



There are a lot of changes going on with Oracle allocating resources for the next release of Java. The NetBeans helps you to stay more current.
jacocks
2016-11-04 01:53:16 UTC
you're able to desire to be working an older version of java than your javac, if thats even achievable. In Ubuntu 6.06 there could exists a JDK kit for you to apt-get. uncertain precisely what that's. seek in Synaptic.


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...