Eclipse : Errors occurred during the build Groovy/Grail Project - eclipse

I have installed GGTS plugin for eclipse kepler 3.5.1 RELEASE. I created simple grail project. But while building project. Its getting error
Errors occurred during the build.
Errors running builder 'Java Builder' on project 'FirstApp'.
org.codehaus.groovy.runtime.StringGroovyMethods.plus(Ljava/lang/String;Ljava/lang/CharSequence;)Ljava/lang/String;
and if we saw in markers, I found this error
Internal compiler error: java.lang.NoSuchMethodError: org.codehaus.groovy.runtime.StringGroovyMethods.plus(Ljava/lang/String;Ljava/lang/CharSequence;)Ljava/lang/String; at
org.codehaus.groovy.grails.transaction.transform.TransactionalTransform.moveOriginalCodeToNewMethod(TransactionalTransform.groovy:259)
Config.groovy /FirstApp/grails-app/conf line 0 Java Problem
I am using feroda 17. Eclipse Kepler.

We were experiencing the same error today, it turned out that the project created by GGTS had a groovy compiler level of 2.3 but the GGTS plugin only supported up to groovy compiler level 2.1.
The fix was to install the "groovy 2.3 compiler for groovy-eclipse".
The compiler can be found under the "language and support tooling" heading in the extensions browser which is opened by clicking the "IDE extensions" button in the STS dashboard.
Although the compiler states that it will automatically become the default workspace compiler in eclipse this did not happen for us. In fact we needed to set it as the workspace default in "preferrences > groovy > compiler" and then restart eclipse (maybe I restarted twice, cant remember exactly).
we also ended up installing "groovy 2.3 compiler for groovy-eclipse" twice as the first time an eclipse IDE update was installed, I think because our kepler installation was a bit old.
Hope this helps.

Related

Scala compiler other than 2.12 not working in Eclipse

I just set up a Scala project in Eclipse (Oxygen 4.7.3a, on Ubuntu 18.04) with the Scala-IDE plugin (4.7.0.v-2_12-201709291352-71a28d0) with a simple HelloWorld object. If I set "Properties -> Scala Compiler" to 2.12 everything works as expected: the project compiles and runs. But if I choose any other version (for instance, "Latest 2.10 bundle (dynamic)" I get prompted to do a full rebuild (as expected) but when I go to "Project -> Build" nothing happens. If I have errors in my code, the editor underlines them, but they won't show in "Problems". If I try to run it I get a class not found error.
I get the feeling that it is not actually compiling. Any ideas on what I need to configure differently?
I finally solved it by removing openjdk-11 and installing openjdk-8. After doing that and reinstalling Eclipse and Scala-IDE everything works fine.
It would have been helpful having some feedback from Eclipse regarding what was not working. I figured it out because I tried to build with SBT and the error lead to this SO question: Failed to initialize compiler: object java.lang.Object in compiler mirror not found
I tried the update-alternatives option (also changing the Java path in eclipse.ini) but then I got the "object java.lang.Object in compiler mirror not found" error in Eclipse problems. Since I didn't need openjdk-11 anyway I simply switched to openjdk-8.

'Can't recognize runtime TestNG version'

Debugging a test in Eclipse, I received "Can't recognize runtime TestNG version"
I just upgraded testNG thru Eclipse to 6.9.11
also upgraded Java to 1.7.0_51
Now I receive the following error in Eclipse: Can't recognize runtime TestNG version
Any help would be appreciated.
I also changed my dependency version to 6.14.3 like above comment. (https://mvnrepository.com/artifact/org.testng/testng/6.14.3)for TestNG in pom.xml
from eclipse Marketplace downloaded TestNG plugin(latest version),and error was resolved.
Eclipse : Neon version
Raised an issue on TestNG GitHub, they have reverted back to the previous version 6.9.10 in Eclipse marketplace. It is working now!
Eclipse:
In my case I worked with Maven,retreived dependencies of TestNG with version 7.0.0-beta1 in pom.xml and tried to execute my first program with TestNg,got "failed to get TestNg version from class Javaillegalargumentexception".
I changed my dependency version as 6.14.3 for TestNG in pom.xml and from eclipse Marketplace downloaded TestNG plugin(latest version),got output successfully.

How do I find the correct Maven archetype project for developing with Scala in Eclipse?

I'm having problems trying to just create a Maven project using Scala (v2.11.6) within Eclipse (Luna). The instructions here says to install both plugins below.
Maven Integration in Eclipse
m2eclipse-scala connector
Both plugins can be installed by using the m2eclipse-scala update site. So here's what I did in my first attempt.
Download Eclipse Luna (for JavaEE developers)
Install "both" plugins above by using the m2eclipse-scala update site.
When Eclipse loads up, I attempt to create a Maven project, and the archetype I want to use is Group Id=net.alchim31.maven, Artifact Id=scala-archetype-simple, Version=1.5. However, this archetype never shows up when I enter in "scala-arch" in the filter text field.
The only project I see is the one with Group Id=org.scala-tools.archetypes, Artifact Id=scala-archetype-simple, Version=1.2. When I select this archetype to use, I get a bunch of error messages in Eclipse.
error while loading ConsoleRunner, Scala signature ConsoleRunner has wrong version expected: 5.0 found: 4.1 in ConsoleRunner.class
error while loading JUnit4, Scala signature JUnit4 has wrong version expected: 5.0 found: 4.1 in JUnit4.class
error while loading Specification, Scala signature Specification has wrong version expected: 5.0 found: 4.1 in Specification.class
In my second attempt, I try to download the pre-packaged bundle (Scala IDE for Eclipse). Again, when I attempt to create a Scala Maven project, I don't see the Maven archetype for Group Id=net.alchim31.maven (only for Group Id=org.scala-tools.archetypes).
Any ideas on what I'm doing wrong here? Or where I can find a vanilla Scala Maven project to import/modify and use for my own purpose?
Here's how I got it to work. It seems all the archetypes aren't available, so based on this answer, I created a remote catalog
Before
So do this
Go to [Windows] → [Preferences] → [Maven] → [Archetypes] → Add Remote Catalog and create the catalog, then Apply
For copy-pasting:
Catalog File: http://repo1.maven.org/maven2/archetype-catalog.xml
Description: Remote Archetypes
Go back to creating a new Maven project. Select the Remote Catalog from the dropdown. It will take a few moments to gather all the archetypes. You can see the progress at the very bottom right of the IDE. When it's done, you should be able to see the archetypes
After
Create your project with groupId and artifactId and such.
Right click the project, then from the context menu [Run As] &rarr [Maven Build]. In the dialog, type clean package into the goals. The run. The project should build and run the tests.
For me at first I got an error on the build. It was because my default environment is using Java 8. I'm pretty new to Scala, so I'm not sure is there is a problem with Scala and Java 8 or not (I think it's the Scala version in the pom (2.10.0)). But what I did to get it to work was just change the Java version used in the IDE to Java 7.
Basically just go to [Windows] → [Preferenes] → [Java] → [Installed JREs] → Add → [System VM] → Next → Directory → Find the directory of the Java home (version 7) → Finish → Then in the list tick Java 7.
Then build again. It should work. Good Luck!
One point I want to add, If you are getting following error while installing the archetype showed in image 1
Can't resolve Archetype
org.glassfish.jersey.archetypes:jersey-quickstart-webapp:2.21
org.eclipse.core.runtime.CoreException: Could not resolve artifact
org.glassfish.jersey.archetypes:jersey-quickstart-webapp:pom:2.21
Image 1:
Then before procedding with the solution specified above, try to complete these steps in eclipse.
I faced the same problem and chanced upon this SO question, as well as the answer, given by #peeskillet (many thanks). I am using:
Maven 3.3.3
Eclipse Luna Scala IDE 4.0.0.-vfinal-20150305-1644-Typesafe
Scala 2.11.6
JDK 1.8
After following the steps exactly as given here, I hit a wall. When I chose the right archetype (net.alchim31.maven), I was greeted with this error:
Could not resolve artifact net.alchim31.maven:scala-archetype-simple:pom:1.5
Suspecting that the maven embedded in eclipse was acting funny, I visited [Windows] -> [Maven] -> [Installations] and added local installation of maven (whatever is set to M2_HOME in my shell). But, no luck!
Exasperated, I visited this site: Scala Doc and switched back to command-line as this page instructs. Surprisingly (to me, at least), it worked. A maven-Scala project was created in the present directory, which I could import into Eclipse.
Just so that I am not misunderstood, I am not suggesting that #peeskillet's answer is wrong. Just wanted to share another way of creating a maven-scala project on Eclipse, in case it helps someone. I have not yet understood, why Eclipse-Scala-IDE is yet to give that 'Aha' feeling.
After you have successfully created the scala-maven project as described above, you will probably see an error "Type not found: type JUnitRunner specs.scala". In that case, manually add the following XML snippet to your pom.
<dependency>
<groupId>org.specs2</groupId>
<artifactId>specs2-junit_${scala.compat.version}</artifactId>
<version>2.4.16</version>
<scope>test</scope>
</dependency>
Moreover, to avoid errors when running mvn test,
[ERROR] scalac error: bad option: '-make:transitive'
You also need to delete the following line from the pom.xml file:
<arg>-make:transitive</arg>

eclipse gives error on start up after adding sbteclipse plugin

I add sbt eclipse plug-in .First I created the project named hello the in project directory i created a file named plugins.sbt and add this line in it
addSbtPlugin("com.typesafe.sbteclipse" % "sbteclipse-plugin" % "2.5.0")
and after the sbt> I typed eclipse then it created the project for eclipse
when I open eclipse it gives me error message
An error has occurred. See the error log for more details
The org.eclipse.jdt.ui.javaElementFilters plug-in extension "scala.tools.eclipse.javaelements.ScalaElementFilter" specifies a viewer filter class which does not exist.
Plug-in org.scala-ide.sdt.core was unable to load class scala.tools.eclipse.javaelements.ScalaElementFilter.
An error occurred while automatically activating bundle org.scala-ide.sdt.core (806).
please help me to how to resolve this error and when I imported the sbt project eclipse give me another error
Building workspace has encountered a problem
Errors occurred during the build.
Error instantiating builder 'org.scala-ide.sdt.core.scalabuilder'.
Plug-in org.scala-ide.sdt.core was unable to load class scala.tools.eclipse.ScalaBuilder.
An error occurred while automatically activating bundle org.scala-ide.sdt.core (806).
Plug-in org.scala-ide.sdt.core was unable to load class scala.tools.eclipse.ScalaBuilder.
An error occurred while automatically activating bundle org.scala-ide.sdt.core (806).
Please help me
scala version 2.11.1
sbt version 0.13
I added the scala-IDE plugin from this source
http://scala-ide.org/download/current.html
i am using eclipse juno and pasted the following location in install new software
http://download.scala-ide.org/sdk/helium/e38/scala211/stable/site
my project compiles successfully in sbt
Are you using Eclipse Luna for Java Developers (as opposed to Eclipse Classic) AND Scala IDE 4.0 milestone 3? There is a known issue (solved in the nightly builds since then), reported on the mailing list here.
You can "fix" it by either upgrading the Scala plugin to a nightly build (they're pretty stable), or going with Eclipse Classic instead.

Eclipse doesn't show java source code

I'm running java 1.6 in Eclipse on my Intel Mac. I'm using the 1.6.0 version under System/Library/Frameworks and set the default compiler to this in Eclipse.
How do I attach the source code?
First, I downloaded the 1.6 source from oracle, thinking I could attach that 'cause the installed 1.6 didn't have source.
When I click a java class to get the Source Code Editor, there are problems:
first, the top line says Compiled from File.java (version 1.5 : 49.0, super bit)
most important, when I attach the 1.6 source jar file, it gets an error:
An error has occurred. See error log for more details.
Unable to create resource org.eclipse.ui.internal.misc.ExternalProgramImageDescriptor#50417ba8
This also appears in the error log:
java.lang.ClassNotFoundException: org.eclipse.ui.internal.views.log.LogView
at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:506)
The Eclipse version is: Eclipse Java EE IDE for Web Developers.
Version: Helios Service Release 2
Build id: 20110218-0911
When I click for installation details, I get:
An internal error occurred during: "Fetching children of _SELF_".
Registry Directory not available: /Users/rfrail/Downloads/eclipse 2/p2/org.eclipse.equinox.p2.engine/profileRegistry.
I'm running Eclipse from my Download directory (it's worked fine in the past); however, there are 2 folders for Eclipse:
eclipse, and
eclipse 2.
So that looks like a source of confusion right there. Eclipse operates fine otherwise.
Can you help, please?
http://java.decompiler.free.fr/ is your answer
it has an eclipse plugin which decompiles code in place