• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 752
  • Last Modified:

Error due to not being Java source level 5

I have some code that I took over and this line:

Vector <Report> reports = new Vector<Report>();

is give me an error of:

Syntax error, parameterized types only available if source level is 5.0

Do I need a particular library (jarfile)?
0
jwright9
Asked:
jwright9
  • 3
  • 2
2 Solutions
 
CEHJCommented:
Suggests that your IDE has to be 'turned' up to 1.5. What is it?
0
 
radarshCommented:
While compiling the file, you need to use -source 1.5 switch
How are you compiling the application? If you are using eclipse
or similar, there is an option in the project properties where you can
set this.

I'm not sure if it's -source 1.5 or -source 5.0

________
radarsh
0
 
CEHJCommented:
>>I'm not sure if it's ...

The former. But this looks more like an IDE message ...
0
 
radarshCommented:
CEHJ, you're right. I checked in eclipse and the error message is identical.

jwright9, you can go to the properties of your project -> Java Compiler
There, select 5.0 in "Compiler Compliance Level" list down. If your options
are disabled, check "Enable Project Specific Settings".

You can do the same in Window -> Preferences

________
radarsh
0
 
CEHJCommented:
:-)
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Amazon Web Services - Basic

Are you thinking about creating an Amazon Web Services account for your business? Not sure where to start? In this course you’ll get an overview of the history of AWS and take a tour of their user interface.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now