Hi all,
When I am trying to build my project it gives the following error.....
C:\buildarea\eSongBulk\src\main\java\com\hfa\esongbulk\service\HibernateSessionFactory.java:[24,36] generics are not supported in -source 1.3
(try -source 1.5 to enable generics)
private static final ThreadLocal<Session> threadLocal = new ThreadLocal<Session>();
But in my Environment Variables my JAVA_HOME is set to jdk1.5.0_10. Is there any reason why maven is not seeing this? How do I make it to?
Or else can I specify the correct JDK in my pom.xml somehow?
Like it or not, by default Maven assume that all source is 1.3 compatible. Well, at least that is what I recall reading somewhere but I am not able to locate the source. Of course the useless Maven documentation is completely silent on what the default value is. In other words, when it fires off the compiler, it uses the option "-source 1.3". If you want it to compile code that requires 1.5, you must set the source version like this:
Peter Johnson wrote:Like it or not, by default Maven assume that all source is 1.3 compatible. Well, at least that is what I recall reading somewhere but I am not able to locate the source. Of course the useless Maven documentation is completely silent on what the default value is. In other words, when it fires off the compiler, it uses the option "-source 1.3". If you want it to compile code that requires 1.5, you must set the source version like this:
Peter is correct and I ran into the same thing. And if you dig a little deeper you will actually find that fact stated, but Maven's documentation does leave somewhat to be desired. Use his compiler plugin settings (above) and all will be well.
Customer surveys are for companies who didn't pay proper attention to begin with.
Jehan Jaleel
Ranch Hand
Joined: Apr 30, 2002
Posts: 176
posted
0
Thanks guys. This worked. You guys are the best!
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to
run our stuff on 16 servers instead of 3.