Java8 and Aspectj plugin are not compatible? - java

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/

Related

Eclipse Oxygen/Neon: Unable to build ANT project

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.

Java project not compatible with legacy versions of Eclipse

I developed a java program in Eclipse Luna using JavaSE1.8. I wanted to generate some static program slices and the only slicing tool I could find was Indus. Indus requires j2sdk1.4.2 and jre 1.5.0 and must be executed on Eclipse 3.2. Unfortunately my project is not compatible with this set up and so I get all sorts of compilation errors when I import my project across.
So - my project works on Eclipse Luna, but not in Eclipse 3.2 and Indus only works on Eclipse 3.2 but not Eclipse Luna. Does anyone know what I can do resolve this?

Version 1.8 of project facet java does not exist

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

Eclipse + Java 8 + Dynamic Web Module

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

jUnit on eclipse Indigo

I installed Eclipse IDE for JavaScript Web Developers, Version: Indigo Service Release 1
Build id: 20110916-0149, in 2011 and use it for java development now but can see no menu about jUnit when I right click on a java class.
Actually jUnit appears nowhere in the menus.
After going around forums, I tried to install JDT, as I understood this is where jUnit is contained. But installation failed because of a conflict with something already installed...
Can you help please ?
FRED
Conflict details :
I get : Cannot complete the install because of a conflicting dependency.
Software being installed: Eclipse Java Development Tools 3.7.2.v20120120-1414-7z8gFcuFMP7BW5XTz0jLTnz0l9B1 (org.eclipse.jdt.feature.group 3.7.2.v20120120-1414-7z8gFcuFMP7BW5XTz0jLTnz0l9B1)
Software currently installed: Shared profile 1.0.0.1325791064663 (SharedProfile_epp.package.javascript 1.0.0.1325791064663)
Only one of the following can be installed at once:
Java Development Tools Launching Support 3.5.0.v20090527 (org.eclipse.jdt.launching 3.5.0.v20090527)
Java Development Tools Launching Support 3.6.0.v20110509 (org.eclipse.jdt.launching 3.6.0.v20110509)
Java Development Tools Launching Support 3.6.1.v20110803_r371 (org.eclipse.jdt.launching 3.6.1.v20110803_r371)
Java Development Tools Launching Support 3.5.1.v20100108_r352 (org.eclipse.jdt.launching 3.5.1.v20100108_r352)
Java Development Tools Launching Support 3.6.1.v20111006_r372 (org.eclipse.jdt.launching 3.6.1.v20111006_r372)
Cannot satisfy dependency:
From: Shared profile 1.0.0.1325791064663 (SharedProfile_epp.package.javascript 1.0.0.1325791064663)
To: org.eclipse.jdt.launching [3.6.1.v20110803_r371]
Cannot satisfy dependency:
From: Eclipse Java Development Tools 3.7.2.v20120120-1414-7z8gFcuFMP7BW5XTz0jLTnz0l9B1 (org.eclipse.jdt.feature.group 3.7.2.v20120120-1414-7z8gFcuFMP7BW5XTz0jLTnz0l9B1)
To: org.eclipse.jdt.launching [3.6.1.v20111006_r372]
This looks pretty odd. Some background:
The plugin "Java Development Tools Launching Support" doesn't like to have different versions of itself installed in Eclipse. Eclipse 3.7.2 comes with version 3.6.1.v20111006_r372.
It seems that you still have old versions from 3.5 and 3.6 installed. Did you upgrade from an old version to 3.7?
Problems like that are usually only solvable by installing Eclipse again. Deleting the plugin on the disk won't help because p2 remembers which plugins are installed and doesn't care whether the plugin still exists. You probably also can't delete the plugin because some other plugin will depend on it.

Categories

Resources