Maven 3.2.5 doesn't work with JDK6 - eclipse

I have an issue and after many attempts don't know how to resolve it.
I have Java/Maven project with JDK 6 and installed Maven 3.2.5 in Eclipse Luna
Now I'm trying to run clean install command to create ZIP package but getting the following error message:
Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project ABC: Fatal error compiling: invalid target release: 1.7
Does someone has this issue before and how do you resolve it.?
Could you help me please?
Thanks in advance.

The project you are attempting to compile specifies that the generated bytecode should be for Java 1.7. To do that you have to have a JDK7 or later.
Either change the project to specify 1.6, or upgrade your Java to 1.7. (There is really no reason to still stay on Java 1.6, it is old and obsolete now.)

Related

Scala: packages cannot be represented as URI

I have openjdk, scala and sbt, all installed via brew. I'm trying to
get setup to work on the scala track on exercism. I'm having no
troubles with Java or anything that uses the JVM like clojure, but
when I try to test my installation of scala by running the test for
the exercism hello example:
$ sbt test
I get a bunch of errors that seem to start with this:
java.io.IOError: java.lang.RuntimeException:
/packages cannot be represented as URI
My installed versions are as follows:
$ java --version
openjdk 13.0.1 2019-10-15
OpenJDK Runtime Environment AdoptOpenJDK (build 13.0.1+9)
OpenJDK 64-Bit Server VM AdoptOpenJDK (build 13.0.1+9, mixed mode, sharing)
$ scala -version
Scala code runner version 2.13.1 --
$ sbt --version
sbt version in this project: 1.3.8
sbt script version: 1.3.8
I've looked and seen this error in a few questions but not seen a way to fix it.
I solved the issue by installing a java version of 1.8 and set JAVA_HOME towards this version.
export JAVA_HOME="/Library/Java/JavaVirtualMachines/jdk1.8.0_251.jdk/Contents/Home"
I've got the same issue on IntelliJ IDEA and solved it with
Settings > Build, Exec... > Build Tools > sbt > JRE > set to 1.8.
JAVA_HOME has not resolve it in my case
In my case, in Intellij IDEA, I had JAVA_HOME as well as sbt JRE from the previous answer set to 1.8, but I completely forgot about the Project SDK, which was set to an incompatible version.
Ctrl + Alt + Shift + S > Project Settings > Project > Project SDK
Setting this to 1.8 as well as language levels of modules to 8 fixed my issues.
Intellij :
open Settings -> Build, Execution, Deployment -> Scala Compiler -> Scala Compile Server, then change the JDK to the one your project used. This solution solved my problem.
IntelliJ:
Go to File -> Settings -> Build, Execution, Deployment -> Build Tools -> sbt
Make sure Use sbt shell for build is checked
I found this S/O answer solves my issue:
This is a Scala compiler bug. Please upgrade to the latest Scala point release, 2.12.16.

Fatal error compiling: tools.jar not found: C:\Program Files\Java\jre6\..\lib\tools.jar ->

I am having a strange issue. I am using maven 3.2, java 1.6 and jboss 5.1.
I am using all these old version because I have some system requirement.
I am working on web application.
I am getting an error
Fatal error compiling: tools.jar not found: C:\Program Files\Java\jre6\..\lib\tools.jar ->
imperviously it was working fine. When I made some changes in code and when I did this from that time I am getting This error.
I tried updating maven forcefully.
I tried maven install from eclipse.
Even I downloaded the missing jar and put into C:\Program
Files\Java\jre6\..\lib\ this path.
and many more still I am getting this error. please help me.
I think your eclipse is pointed to JRE not JDK. Can you point it to JDK and check?
Mistake you did is ---
Your build path is pointing to the wrong JRE directory/folder. So, you have to change the build path to JRE folder(which is inside the JDK folder) rather not the JRE folder that's available outside the JDK.
Eclipse > Select Windows > properties > Java > Installed JREs
• Select the "jreX" under the Installed JREs list > Select "Edit" or double click
• Your JRE home directory location may be pointing to something like
JRE home: C:..\Java\jre1.x --- (which is wrong)
• Point to the right directory as follows:
JRE home: C:..\java\jdk1.x\jre --- (this is right)
• Finish.
Clean your project and compile it. It should work fine :)

Getting Gradle error when starting STS

I am using STS 3.6.0 and during STS startup I am getting error:
org.eclipse.osgi.internal.framework.EquinoxConfiguration$1
Could not fetch model of type 'EclipseProject' using Gradle installation 'C:\build-tools\gradle-1.10'.
And I can't run Gradle task for the project. Any suggestion?
The error message looks similar to the error in this bug [1].
This bug is actually caused by a bug in Eclipse 4.4.2 [2]. There are a few things you can do to avoid this bug:
You can try a more recent version of gradle tooling (and/or STS)
install the workaround from eclipse update site as explained in comment 51 [3] of the Eclipse bug
[1] https://issuetracker.springsource.com/browse/STS-3922
[2] https://bugs.eclipse.org/bugs/show_bug.cgi?id=445122
[3] https://bugs.eclipse.org/bugs/show_bug.cgi?id=445122#c51

Unity - Failed to compile resources with the following parameters:

I'm working on adding Google Play Game Services to a Unity project.
Started getting these errors recently, however not sure if it is because of the Game Services, or could be I updated my machine.
The following in Console output:
Failed to compile resources with the following parameters:
-bootclasspath "/Users/alex/development/adt-bundle-mac-x86_64-20131030/sdk/platforms/android-21/android.jar"
-d "/Users/alex/Documents/development/unity/Maze/Maze/Temp/StagingArea/bin/classes"
-source 1.6 -target 1.6 -encoding UTF-8 "com/facebook/android/R.java" "com/google/android/gms/R.java"
"com/google/example/games/basegameutils/R.java"
"com/google/example/games/mainlibproj/R.java"
"com/mildspring/maze/R.java" warning:
java/lang/Object.class(java/lang:Object.class): major version 51 is
newer than 50, the highest major version supported by this compiler.
It is recommended that the compiler be upgraded. 1 warning
UnityEditor.HostView:OnGUI()
Error building Player: UnityException: Resource compilation failed!
Failed to recompile android resource files. See the Console for
details.
Got my answer, the issue was that "major version 51" is java 1.7, "version 50" is java 1.6. The solution was to install Java 1.7 and set path accordingly with the following command.
sudo ln -nsf /Library/Java/JavaVirtualMachines/jdk1.7.0_71.jdk/Contents /System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK
For me, changing the JDK path at Preferences => External Tools => JDK finally resolved this issue. Creating the symbolic link wasn't enough or possibly not even needed.
I would just re-install or update JDK , And its work
http://www.oracle.com/technetwork/java/javase/downloads/index.html

RoboVM not working on JDK 1.8.0 b112

I'm running Eclipse with RoboVM plugin and I wanted to try IOSDemo sample project described on robovm.org (http://www.robovm.org/docs.html). When creating the project in Eclipse and running it I got following error message.
An internal error occurred during: "Launching IOSDemo".
java.lang.IllegalAccessError: tried to access method java.lang.Object.clone()Ljava/lang/Object; from class soot.toolkits.scalar.LocalSplitter
I found out that it's related to JDK version (I'm running JDK 8.0 ea, build 112). When running on JDK 1.7.0_45 and building the project on cmd line it builds and runs OK.
Is it known problem, is there any workaround or fix? Thanks
This is most probably due to a bug [1] in the recent early access builds of Java8. It looks like the bug was resolved a few days ago but as far as I can see the fix didn't make it into the b113 build. Please use the latest Java7 release or an earlier Java8 EA build until a Java8 build is available with this fix included.
[1] https://bugs.openjdk.java.net/browse/JDK-8026394