0

My question is simple: is there a version of the Maven-shade-plugin that is compatible with Java version 7? Specifically, when I attempt to use this plugin I get the following error (using Netbeans IDE):

diamond operator is not supported in -source 1.5
  (use -source 7 or higher to enable diamond operator)

And when I attempt to compile I receive this warning:

error: multi-catch statement is not supported in -source 1.5

So it appears that I just need a plugin compatible with Java 7.

derigible
  • 964
  • 5
  • 15
  • 32
  • Are you sure it is the maven-shade plugin that causes the problems? The sparse messages rather suggest that you are using Java 7 features in your code, but have set your compiler plugin to use JDK 1.5 level. Or someting like that. Maybe run Maven from the commandline, say "mvn -X compile" and post the error messages here. – Gyro Gearless Mar 19 '13 at 22:19

1 Answers1

0

It might not be the plugins fault, maven by default uses 1.5 which does not mean that the plugin will not work with 1.6 or 1.7, maybe you just need to configure it for the correct java version. See: https://stackoverflow.com/a/9927172/1042999 for an example.

Community
  • 1
  • 1
Sinisha Mihajlovski
  • 1,811
  • 1
  • 20
  • 34
  • Thanks for the input. I am still new at Java programming and only recently have started using Maven. It was an issue with not having the maven-compiler-plugin. – derigible Mar 20 '13 at 01:55