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.
Related
I downloaded the libGDX setup jar file, I generated a project and imported it (to eclipse). Once I try to run the project eclipse outputs an error:
Description Resource Path Location Type
Could not create an instance of Tooling API implementation using the specified Gradle distribution 'https://services.gradle.org/distributions/gradle-4.6-bin.zip'.
Could not create service of type FileMetadataAccessor using NativeServices.createFileMetadataAccessor().
Could not determine java version from '11.0.2'.
I have no idea how to solve this problem.
The problem is that you are using Java 11. Try it with Java 8. The HTML module does not compile with a Java version greater then 8.
Gradle 4.6 likely does not support Java 11.
You can either upgrade to a newer version of Gradle or downgrade your JDK version.
I would recommend updating to Gradle 4.10.2 as it is the latest Gradle 4 variant (you can try Gradle 5 however it may introduce some breaking changes)
This can be done by running in the root of your project:
Linux / MacOS:
./gradlew wrapper --gradle-version=4.10.2
Windows:
gradle wrapper --gradle-version=4.10.2
I had a project which is build on java 1.6 and
Now i upgraded the java verion to 1.8 and build the project
Here i have used gradle for building the project
Here is the gradle code
task wsgen(dependsOn: compileJava) {
doLast{
ant {
taskdef(name:'wsgen',
classname:'com.sun.tools.ws.ant.WsGen',
classpath:configurations.jaxws.asPath)
wsgen(keep:true,
destdir: "${buildDir}",
resourcedestdir:"${sourceSets.main.output.resourcesDir}",
sourcedestdir:'src/main/java',
genwsdl:'true',
classpath:"${configurations.compile.asPath}:${sourceSets.main.output.classesDir}",
sei:'<sei implementation class>')
}
}
}
and the error , am getting is
java.lang.NoClassDefFoundError: com/sun/mirror/apt/AnnotationProcessorFactory
Can any one tell me, where the issue is located and raising from?
Thank you!!!
Thanks go out to #McDowell for the useful comment with links. So the APT tool is gone. Use a version 7 JDK for building your project. Just install it alongside your java 8 JDK and create a script specifically for building your project that requires the APT tool.
I had the same problem and went around it by running maven using the 1.7 version of JDK. So I created a script (.cmd on windows platform) that, for me, looks like this:
set JAVA_HOME="c:\Java\ibm-jdk-1.7.0"
set PATH=%JAVA_HOME%\bin;%PATH%
mvn clean install eclipse:eclipse
This will successfully build using an IBM version of the java 7 jdk, which i happen to have in my java folder. I hate the fact that I can't build my projects with the version 1.8 jdk but at least i can use java 8 features on other projects.
I'm learning how to build Jmeter with Eclipse.
I followed some online steps and downloaded Jmeter binary and source files, unzipped them into the same directory, created a java project in eclipse and used ant build but when i build i got the following error
\workspace\apache-jmeter-2.11\build.xml:801: Class not found: javac1.8
I'm using JRE8, JDK1.8 and ant 1.9.4.
Saw some similar post with answers saying that this is an issue with ant version < 1.9 but i'm already using ant 1.9.4.
Help please.
As that is a problem encountered with versions of Ant which are not compliant with Java 8, I suggest you check your Ant configuration. Go to your Eclipse settings and check it. Then, check your project settings, maybe you have project-specific settings which override your general Eclipse settings.
In the settings, you can choose which Ant install you want to use. By default, Eclipse is using it's own, which is probably not the last available. If you have installed Ant 1.9.4, you should select "External installation" or something, with the version of Ant you installed.
More infos here: http://help.eclipse.org/juno/index.jsp?topic=%2Forg.eclipse.platform.doc.user%2Ftasks%2Ftasks-ant-version.htm
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
I was looking for examples on how to create an XML File in ANT for Java project using Apache POI library. I encountered this statement:
POI 3.5 and later requires the JDK version 1.5 or later. Versions prior to 3.5 require JDK 1.4+ here
I am using Apache 3.9 and set the JDK of my project to Java 1.4 and I didn't encounter any error when trying to run my program via eclipse. But my question is if I make build.xml in ANT and deploy the JAR file. Will my project still run(3)?
Extra info
I created a build.xml using the ANT plugin in eclipse then Run as --> Ant Build. I didn't encounter any error.
Also set the JRE to JDK1.4
I haven't tested this yet if it runs or not because I still don't know how to add a JAR configuration in build.xml... I am still learning how to use ANT.
If the project states that JDK 1.5 or higher is required it means that usually no testing is done with lower versions. It might still work (to some degree) as you found out, but likely will stop working with newer version of Apache POI.