I'm trying to build a Dynamic Web Application in eclipse using Java 8 (and Wildfly appServer if that matters) but I'm unable to make Eclipse Luna M5 use Java 8 (I do have Java 8 BETA support installed and it works on JavaSE projects).
In my POM I set the level to Java 8:
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
But after I do maven -> update project I get the following error:
Could not update project ExampleApp configuration
Version 1.8 of project facet java does not exist.
And indeed there is no java 1.8 project facet under project->preferences->project facets->java
Can I manually create such facet and add It to to eclipse or I'll have to wait until java 8 is released and the eclipse guys decide to add it ?
There are additional patches available for Kepler SR2 officially.
In ecliplse, go to "Help" --> "Market Place" --> Search for java 8 kepler.
Then choose and install the following.
install Java 8 support eclipse kepler sr2,
Java 8 Facets for web tools eclipse kepler sr2
Java 8 support for m2e for Eclipse Kepler SR2 (if required)
Reference: http://www.eclipse.org/downloads/java8/
After this, my multi-module maven project with java 8 is building fine without any error in eclipse kepler SR2.
UPDATE: If you are using Spring Tool Suite (STS), then version 3.5.1 has included these features.
There is an official bug report/patch for Kepler SR2. It also works with Spring Tool Suite 3.5.0.RC4 (which is based on Kepler). It should work for Luna too.
Bug report : https://bugs.eclipse.org/bugs/show_bug.cgi?id=430637 (see comment #12)
Update site for the Java 8 facet : http://download.eclipse.org/webtools/patches/drops/R3.5.2/P-3.5.2-20140329045715/repository
While we await official Java 1.8 support, I've made a github fork that contains what I believe are the required changes - these require the Java 8 patches from here first: https://wiki.eclipse.org/JDT_Core/Java8
To install the 1.8 facet support (assuming that you're running 4.3.1 or 4.3.2, and have write access to the main .../eclipse/plugins dir):
git clone https://github.com/stevestorey/webtools.common.fproj
git checkout java8-support
Import the various projects in this feature set into your Eclipse IDE (can be on a new workspace). Specifically you need org.eclipse.wst.common.project.facet.core and org.eclipse.wst.common.project.facet.core
Right click on the org.eclipse.jst.common.project.facet.core project and choose "Export" and then "Plug-in development\Deployable plugins and fragments"
From the Export dialog, select only the org.eclipse.jst.common.project.facet.core plugin, and choose the bottom "Install into host" radio button, and choose a suitable path (I believe I went with the default, but I don't think it particularly matters)
Clicking Finish will build the plugin, and then kick off the installation into your Eclipse environment.
After restarting Eclipse, you should find that 1.8 is now selectable as a Java facet :) (and it also works with M2E enabled projects that specify source/target of 1.8).
Note the instruction from the standard 1.8 patch instructions that the installed JDK /must/ be called "JavaSE-1.8" within the Eclipse properties.
Also note that if/when you update Eclipse (e.g. to upgrade to 4.3.2), you will probably need to re-install the patched version again as the update will put the "official" version of the plugin back in.
I hit exactly the same problem a few days ago. Looks like this will be included into the next release of Eclipse Luna.
Java Version 1.8 of project facet java does not exist
Eclipse Luna M6 is scheduled for release on March 14th so hopefully it will be included then.
Recently Java updated to Java 8 so you need to update to the new Eclipse for it to work. I was running Eclipse 4.3 (Kepler) and I had to upgrade to Eclipse 4.4 (Luna)
Go to Your Project Property search for project facet and change java version
Related
I recently upgraded to Eclipse Neon. I had a plugin project that built fine in Eclipse Luna, but now in neon, everywhere that I imported "org.eclipse."something I get an error:
The import org.eclipse cannot be resolved.
The plugin.xml has errors etc.
The Project build path has "Plugin Dependencies" on the build path.
My version of Eclipse is
Eclipse IDE for Eclipse Committers
Version: Neon.3 Release (4.6.3)
Build id: 20170314-1500
I'm running on MacOSX High Sierra.
It's probably something very simple.
I have a similar problem every time I upgrade my eclipse installation.
For me the problem can be solved by adjusting the Target platform (can be found in the settings - just search for it) to match the currently running one. For that in most cases I simply add a target platform with default configuration and set that one active.
After a rebuild (normally performed automatically) all those errors are gone.
I'm running Eclipse 2018-09 (4.9.0) on Windows 10. I'm using Open JDK 11 GA. I have a Maven project that was specified as using Java 8 source code.
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
</properties>
That compiles fine using Maven 3.5.3 on the command line. That also compiles fine using Eclipse Eclipse 2018-09 (4.9.0).
I changed the compile Java versions to Java 11:
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
</properties>
That still builds fine on the command line using Maven 3.5.3. But in Eclipse 2018-09, I get errors all over the place:
'<>' operator is not allowed for source level below 1.7
Constructor references are allowed only at source level 1.8 or above
Default methods are allowed only at source level 1.8 or above
You get the idea.
I've already used Alt+F5 to update my Maven project (and subprojects) in Eclipse. I've done a complete clean and rebuild.
Because this compiles fine with Maven on the command line, this has to be an Eclipse problem, doesn't it? Sure, Eclipse doesn't support all new Java 11 features, yet, but this code has no Java 11 specific features. What's wrong?
It sounds like Eclipse is not picking up the versions from the pom.
I just tested your pom configuration and verified that it works, either by providing compiler source and target properties like in the question or the new release property as described in this answer, using the latest Java 11 Support for Eclipse 2018-09 plugin.
It is important that the the JDK 11 is correctly set up in the Eclipse preferences. Add the JDK 11 on the "Installed JRE" preference page and then match it with the JavaSE-11 on the "Execution Environment" preference page. Otherwise updating the Maven project will result in the default JDK being used, which is likely the issue that you are having.
Update: Java 11 is fully integrated in Eclipse since Version 4.10 (released 2018-12-19), so one do not need to install this plugin anymore.
For some reason you need to install an additional Eclipse Plugin "Java 11 Support for Eclipse 2018-09 (4.9)" (even in Eclipse Photon 4.9)
It seams that the plugin is not available in Eclipse Marketplace anymore. I someone find its install url, please add it here:
Works for Eclipse - STS 4.0.1 (based on Eclipse 4.9) , Maven 3.6.0, with this Maven Compiler Plugin Configuration
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.0</version>
<configuration>
<source>11</source>
<target>11</target>
</configuration>
</plugin>
This problem is fixed in Eclipse 2018-12. Upgrading to that version will resolve your issue.
No need to add any plugin.
You only need to upgrade eclipse such that it can handle jdk 11 compiler like mentioned in the attachment.
You don't need to upgrade eclipse in case you have the option to set the jdk 11 compiler.
**Note: Go to the Java Compiler post selecting the project properties and then Click on Configure Workspace settings to mention JDK 11.
I am running into an issue. I am trying to build my code which is a legacy one built on Java 1.6. However, when i am trying to build it using ANT with a similar version then run into the JRE version 1.7 or greater is supported. I tried following instructions with Eclipse NEON but no luck.
https://blog.sibvisions.com/2016/06/30/eclipse-neon-with-ant-and-jre6/
I have a Eclipse Oxygen IDE and tried with it too but even it doesn't work.
The only challenge I can't move to the latest version while building .xml file is because the hosting server supports JDK 1.6 only.
Incase, if there is a way out then please suggest.
P.S:- added the error message in the below comment.
HERE IS THE ERROR MESSAGE
the JRE version 1.7 or greater is supported"
The ANT plugin form blog.sibvisions.com was created for Neon or Mars. There's a new plugin available for Oxygen.1. Simply search the blog.
The problem with eclipse is that the standard ANT plugin was created based on Java 7 and it has a version check built-in. It's not possible to use the standard ANT plugin with Java6... So use an older eclipse version or the modified ANT plugin.
I don't know the reason why the original ANT plugin is using Java 7 because the source can be written with Java 6 compatibility without problems. This is what the modified ANT plugin does.
I'm using eclipse Kepler 4.3.2 with STS, Maven and other Web development tools. Today i thinked about trying some lambdas with Java 8, so I installed JDK1.8 and Eclipse Plug-in Development Environment Patch with Java 8 support (for Kepler SR2). It was working but when I opened project i was working with I got bunch build errors in dispatcher-servlet.xml:
Build path is incomplete. Cannot find class file for org/aspectj/weaver/reflect/ReflectionWorld$ReflectionWorldException
It looked like AspectJ plugin was uninstalled, so I installed it again:
AspectJ Development Tools (AJDT) including the AspectJ compiler.
AspectJ compiler for Eclipse
After rebuiling, project works again but I cant use lambdas. In preferences > Compiler compliance level there isn't Java 1.8. It was there before installing AspectJ stuff.
What can I do to make this work together?
You can install the most recent development version of AspectJ plug-in for Kepler, which supports Java 8 at http://download.eclipse.org/tools/ajdt/43/dev/update
Then re-install the JDT update at http://download.eclipse.org/eclipse/updates/4.3-P-builds/
I'm starting a new project and considering moving to Java 8 already, since newest Spring Framework 4.0 supports it, and it's not so long until final release this march.
Currently we are using STS 3.4 (Eclipse 4.3.1 based) and I have installed latest JDK8 and Java 8 (BETA) support. Simple projects seems to find themselves at home with Java 8, but not UI project (Dynamic Web Module 3.0, the one deployed on server). I'm getting error that compiler version (1.8 BETA) doesn't match installed project facet "Java" (1.7). And there is no such option "1.8" in "Java" project facet...
Have anybody succeeded running UI project with Java 8?
Thanks!
Have you tried to install WTP's org.eclipse.jst.common.fproj.enablement.jdt.feature.patch from here?
http://download.eclipse.org/webtools/patches/drops/R3.5.2/P-3.5.2-20140329045715/repository
You might also want support for Java 8 in Maven, PDE, and JDT.
For those features, use these sites:
Maven (M2E) 1.4.1 (org.eclipse.m2e.feature) http://download.eclipse.org/technology/m2e/releases/1.4/1.4.1.20140328-1905
JDT & PDE Feature patches : http://download.eclipse.org/eclipse/updates/4.3-P-builds/
If you happen to be a fan of JBoss Tools, it's coming directly to JBoss Central:
https://issues.jboss.org/browse/JBIDE-17002