Home > Java > Syntax error, parameterized types are only available if source level is 1.5

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

December 19th, 2009 Nick Leave a comment Go to comments

I recently installed Eclipse and all of a sudden my Java applications failed to build with the error:

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

After a bit of Googling I figured out that Eclipse installed a different JVM and set it as the default one.   On Ubuntu (at least) the way to change the default JVM is by typing this into the console:

sudo update-alternatives --config java

It will show you which JVM is currently selected and allow you to choose a different one as default.

Categories: Java Tags: , , , , , ,
  1. January 13th, 2010 at 23:24 | #1

    It seems installing Eclipse was a really bad idea. I’ve been getting more cryptic messages from the Java compiler, so I tried javac -v and low and behold it’s a special Eclipse flavour of the compiler. Running this seemed to help:

    sudo update-java-alternatives -s java-6-sun

    Now I have the Sun compiler back, but I am wondering how many other skeletons Eclipse has left in the wardrobe.

  1. No trackbacks yet.