Java-Version of WAR product [message #929099] |
Mon, 01 October 2012 08:10  |
Eclipse User |
|
|
|
Hi everyone!
I've got a problem concerning the creation of a WAR. I created it using a warproduct-file, but when I deploy it, I get the following message:
java.lang.Error: Unresolved compilation problem:
'<>' operator is not allowed for source level below 1.7
I took a look at the class-file with the error, and instead of compiled code it just contains the stack trace of above exception. Then I checked the plug-in in question: Both the build path and the manifest state it's a Java 7 project.
So my question is: Why would the WAR product export wizard assume the project to be anything other than a Java 7 project? How do I change it? And is there a way to tell the export wizard to just show an error message and stop exporting when a error like this happens, instead of ignoring it?
Thanks in advance,
S. Schulz
|
|
|
Re: Java-Version of WAR product [message #931521 is a reply to message #929099] |
Wed, 03 October 2012 09:26   |
Eclipse User |
|
|
|
Hi,
check your project properties - "Java Compiler" settings. What are your
"JDK Compliance" settings?
Best,
Ivan
On 10/1/2012 11:10 AM, S. Schulz wrote:
> Hi everyone!
>
> I've got a problem concerning the creation of a WAR. I created it
> using a warproduct-file, but when I deploy it, I get the following
> message:
>
> java.lang.Error: Unresolved compilation problem: '<>' operator is
> not allowed for source level below 1.7
>
> I took a look at the class-file with the error, and instead of
> compiled code it just contains the stack trace of above exception.
> Then I checked the plug-in in question: Both the build path and the
> manifest state it's a Java 7 project.
> So my question is: Why would the WAR product export wizard assume the
> project to be anything other than a Java 7 project? How do I change
> it? And is there a way to tell the export wizard to just show an error
> message and stop exporting when a error like this happens, instead of
> ignoring it?
>
> Thanks in advance,
>
> S. Schulz
--
Ivan Furnadjiev
Twitter: @EclipseRAP
Blog: http://eclipsesource.com/blogs/
Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
|
|
|
|
|
Re: Java-Version of WAR product [message #933664 is a reply to message #933643] |
Fri, 05 October 2012 08:14   |
Eclipse User |
|
|
|
> Does this entry also show "JavaSE-1.7"?
Yes, it does.
> When you export your project from the IDE, does this use the correct compiler level?
No, it doesn't either.
> I'm not even sure if PDE/build supports Java 1.7
You're kidding, right? How could Eclipse itself not support the entire build process for its very own framework?
(And I read the link, but don't know what you think is relevant to the problem.)
|
|
|
Re: Java-Version of WAR product [message #934125 is a reply to message #933664] |
Fri, 05 October 2012 17:26   |
Eclipse User |
|
|
|
I verified that PDE and the WAR Product Tooling are able to build plugins using Java 7 source.
I think you are probably missing the OSGi Execution Environment. Open the plugin's manifest editor and verify that JavaSE-1.7 is listed under Execution Environments like this:

With JavaSE-1.7 listed there it was able to build properly, but when I removed it the build failed with the same error you described.
Hope that helps,
Cole
|
|
|
Re: Java-Version of WAR product [message #936576 is a reply to message #934125] |
Mon, 08 October 2012 05:51   |
Eclipse User |
|
|
|
> I think you are probably missing the OSGi Execution Environment.
No, as I said above the manifest contains the right Java version. It's funny, even the MANIFEST.MF inside the plug-ins inside the WAR still says "JavaSE-1.7", but the classes using actual Java 7 code are not compiled correctly.
|
|
|
|
Powered by
FUDForum. Page generated in 0.24648 seconds