facing issue with GWT designer mode - eclipse

I'm working with Eclipse Helios 3.6 (32-bit). I installed the GWT plug-in and created a new Web application. In the Client folder I was trying to open a file with GWT designer, but unfortunately I was getting an error:
Internal Error encountered unexpected internal error. This could be caused by a bug or by a misconfiguration issue, conflict, partial update, etc.
java.lang.UnsupportedClassVersionError: Bad version number in .class file
Stack trace:
java.lang.UnsupportedClassVersionError: Bad version number in .class file
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
at java.net.URLClassLoader.access$100(URLClassLoader.java:56)
at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at java.lang.ClassLoader.loadClass(ClassLoader.java:299)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at com.google.gdt.eclipse.designer.hosted.tdt.HostedModeSupport.loadImpl
(HostedModeSupport.java:110)
at com.google.gdt.eclipse.designer.hosted.tdt.HostedModeSupport.<init>
(HostedModeSupport.java:83)
at com.google.gdt.eclipse.designer.hosted.tdt.HostedModeSupportFactory.create
(HostedModeSupportFactory.java:32)
at com.google.gdt.eclipse.designer.model.widgets.support.GwtState.getHostedModeSupport
(GwtState... (missing part here)
...org.eclipse.wb.internal.core.editor.errors.ExceptionComposite$3.widgetSelected
(ExceptionComposite.java:129)
--- etc
I have JavaCompiler in project properties 1.6 and from preferences->java->installed JDK/JRE using 1.6.

I am not sure of the specifics but most likely you are trying to run the designer with JDK 1.5. That is the cause of that error. I would recheck everything.
Also off the top of my head I would verify 32 bit versus 64 bit java sdk.

Generally when anything is wrong in JavaCompiler Project properties it will throw error of major/minor version 51.0 . So here most probably by checking the java version installed in the system and the version through which you are working are differnet. Make both of them compatible and the error will be solved.

Related

How to clean up an ionic project? (MultiDex error)

hope you can help me out.
I'm having a big issue to run my app on Genymotion emulator and on my real device, it's been a few days since I got stuck on this. The problem is that I'm getting the MultiDex error. I already follow those two steps on
Multidex, I added the multiDexEnabled true line on my build.gradle file and I also add the class from the multidex support library on my Manifest.
After a few hours of search I discovered that I need to clean up my project to prevent it to get over the 65k methods supported by Android (MultiDex error), but (there's always a "but") I'm new on ionic development and I don't know what I can delete and what I can not delete, what's important and what's it's not important.
After a few changes trying to solve it, the error changed from MultiDex to DexDebug, I'm not an expert, but I think it's almost the same. Sorry if I'm wrong about it, it's just a guess.
Can someone help me to understand that and help me to solve this issue?
As I'm not allowed to use images yet, The print screen that shows my project structure, the error, and the emulator (with no sign of the app) is posted here
The error in your posted screenshot says:
java.lang.UnsupportedClassVersionError: com/android/dx/command/Main : Unsupported major.minor version 52.0
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:800)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:482)
Your com/android/dx/command/Main class (which is part of dx tool) that your build script tries to invoke was compiled with Java 1.8 (major.minor version 52.0), while it is being executed with JDK 1.7 (as you can see in log).
You have two options to fix this error:
Install JDK 1.8 and let Gradle use it (for example, by pointing JAVA_HOME to 1.8's path).
or
Revert buildtools to an older version, for example buildToolsVersion "23.0.2".

maven-scr-plugin fails with SCRDescriptorException "unable to scan files ... Class file format probably not supported by ASM ?"

Using the following dependencies (amongst others, the bundle is supposed to be installed to AEM 6.1)
runtime is java8
maven-scr-plugin 1.15.0
org.apache.felix.scr.annotations: 1.9.8
org.apache.felix.scr.ds-annotations: 1.2.8
I get this exception
Caused by: org.apache.felix.scrplugin.SCRDescriptorException: Unable to scan class files: ...
(Class file format probably not supported by ASM ?)
at org.apache.felix.scrplugin.helper.ClassScanner.processClass(ClassScanner.java:219)
at org.apache.felix.scrplugin.helper.ClassScanner.process(ClassScanner.java:161)
at org.apache.felix.scrplugin.helper.ClassScanner.scanSources(ClassScanner.java:146)
at org.apache.felix.scrplugin.SCRDescriptorGenerator.execute(SCRDescriptorGenerator.java:146)
at org.apache.felix.scrplugin.mojo.SCRDescriptorMojo.execute(SCRDescriptorMojo.java:221)
... 22 more
Caused by: java.lang.IllegalArgumentException
at org.objectweb.asm.ClassReader.(Unknown Source)
at org.objectweb.asm.ClassReader.(Unknown Source)
at org.objectweb.asm.ClassReader.(Unknown Source)
at org.apache.felix.scrplugin.helper.ClassScanner.processClass(ClassScanner.java:201)
The class in question does not contain any osgi annotations at all, but is merely imported in some other #Component annotated classes.
Did anyone encounter this and found a solution?
I ran into this issue today. This happens when you are running maven-scr-plugin with scanClasses=true option. Older versions of maven-scr-plugin cannot scan classfile generated by java8. you will have to either switch to a newer version of scr plugin (I upgraded to 1.22) or set you maven-compiler-plugin target config to 1.7
I found out that my Felix SCR Annotation Processor plugin that I installed to my Intellij as a prerequisite to using the aem-ide-tooling-4-intellij from headwirecom is causing the issue. It was working for quite a while until today suddenly giving me an issue in running my unit tests (needless to say, there were no changes made in my java, mvn versions or in my IDE).
This forced me to update my java version, intellij version but didn't fix the issue. But disabled the SCR annotation plugin fixed it.
As you can see, this plugin is really old (2014). I hope they will release a newer version soon.

Error building Intellij Scala Plugin

I am trying to follow the instructions at
https://confluence.jetbrains.com/display/SCA/Setting+up+Scala+plugin+project+in+IntelliJ+IDEA
I am using Idea 14.1.14.
Have downloaded the sources and downloadIdea.
And after importing the project set the Project SDK to 1.7.
Not sure if the above is enough info to go on; but on make project I get the below error; is it possible to guess at what I've got incorrect?
Error:scalac: error while loading Object, Missing dependency 'object scala in compiler mirror', required by /usr/lib/jvm/java-7-oracle/jre/lib/rt.jar(java/lang/Object.class)
Error:scalac: Error: object scala in compiler mirror not found.
scala.reflect.internal.MissingRequirementError: object scala in compiler mirror not found.
at scala.reflect.internal.MissingRequirementError$.signal(MissingRequirementError.scala:17)
at scala.reflect.internal.MissingRequirementError$.notFound(MissingRequirementError.scala:18)
at scala.reflect.internal.Mirrors$RootsBase.getModuleOrClass(Mirrors.scala:53)
at scala.reflect.internal.Mirrors$RootsBase.getModuleOrClass(Mirrors.scala:66)
at scala.reflect.internal.Mirrors$RootsBase.getPackage(Mirrors.scala:173)
at scala.reflect.internal.Definitions$DefinitionsClass.ScalaPackage$lzycompute(Definitions.scala:161)
at scala.reflect.internal.Definitions$DefinitionsClass.ScalaPackage(Definitions.scala:161)
at scala.reflect.internal.Definitions$DefinitionsClass.ScalaPackageClass$lzycompute(Definitions.scala:162)
at scala.reflect.internal.Definitions$DefinitionsClass.ScalaPackageClass(Definitions.scala:162)
at scala.reflect.internal.Definitions$DefinitionsClass.init(Definitions.scala:1377)
at scala.tools.nsc.Global$Run.<init>(Global.scala:1229)
at xsbt.CachedCompiler0$$anon$2.<init>(CompilerInterface.scala:116)
at xsbt.CachedCompiler0.run(CompilerInterface.scala:116)
at xsbt.CachedCompiler0.run(CompilerInterface.scala:102)
at xsbt.CompilerInterface.run(CompilerInterface.scala:27)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at sbt.compiler.AnalyzingCompiler.call(AnalyzingCompiler.scala:102)
at sbt.compiler.AnalyzingCompiler.compile(AnalyzingCompiler.scala:48)
at sbt.compiler.AnalyzingCompiler.compile(AnalyzingCompiler.scala:41)
at org.jetbrains.jps.incremental.scala.local.IdeaIncrementalCompiler.compile(IdeaIncrementalCompiler.scala:29)
at org.jetbrains.jps.incremental.scala.local.LocalServer.compile(LocalServer.scala:26)
at org.jetbrains.jps.incremental.scala.remote.Main$.make(Main.scala:62)
at org.jetbrains.jps.incremental.scala.remote.Main$.nailMain(Main.scala:20)
at org.jetbrains.jps.incremental.scala.remote.Main.nailMain(Main.scala)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at com.martiansoftware.nailgun.NGSession.run(NGSession.java:319)
Warning:scalac: No 'scala-library*.jar' in module dependencies [compiler_settings]
Go to File -> Project structure -> Global libraries and add Scala SDK there. In my case, two SDKs were already present (in ivy folder) and offered for selection.
I have faced a similar issue recently even after having the compatible versions of java,sbt and scala SDK but found few reasons why we get this error when we importing sbt project into Intellij.
Check the scala-SDK is present in the global libraries under File->Project Structure -> Global Libraries.
Please find the below screenshot.
Even after fixing the first issue you still face this issue. Then look for the external dependencies which you have placed under /lib folder check the checksum of that jar if possible are make sure it has the right size. This should solve the issue.
Apart from the above issue, you might end up with dependencies source linking issues in the code when you open the project in IntelliJ. This is because of the additional root modules which are present under File -> Project modules -> modules. In the modules panel, you will see projectxxx-src and projectxx-test additional to projexctxx-process and projectxx-process-build. So remove the projectxx-src and projectxx-test.
You have to have Java 8 JDK for Scala to work
see the scala site for further info
Only Java 8 JDK version should be used along side scala. Not even higher JDK versions.
better also check here. It solved my own building errors
In my case, I had to specify the correct JDK home path in the Project structure -> SDKs.
Since my JAVA_HOME variable was not set yet, Intellij was taking a default value which doesn't exist.
Replace the JDK Home Path by the the right path of the JDK (in my case it was the following : /Library/Java/JavaVirtualMachines/adoptopenjdk-8.jdk/Contents/Home)
Replace 'adoptopenjdk-8.jdk' by your folders' name (might be jdk_1.8.0_xxx.jdk)
I hope it helps.
Double-Check JDK Compatibility
I encountered this issue when the Java SDK being used by my IntelliJ project was too "new" for the version of Scala I was using. For example, IntelliJ defaulted to using Java 12 for my project when my project was using Scala version 2.11.8. However, according to the documentation, the minimum required Scala version for JDK 11 is 2.11.12; therefore, I resolved this problem by changing the JDK used in IntelliJ to Java 8 by going to File -> Project Structure -> Project -> Project SDK

IntelliJ IDEA crashes on startup, plugin error

When trying to start IntelliJ IDEA 14 Ultimate on a newly upgraded OS X Yosemite, I get the following exception in a dialog window, aborting IDEA startup:
Plugin 'DBN' failed to initialize and will be disabled. Please restart IntelliJ IDEA.
java.lang.ClassNotFoundException: com.dci.intellij.dbn.DatabaseNavigator PluginClassLoader[DBN, 3.0.3501]
at com.intellij.ide.plugins.cl.PluginClassLoader.loadClass(PluginClassLoader.java:68)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:249)
at com.intellij.openapi.components.impl.ComponentManagerImpl$ComponentsRegistry.a(ComponentManagerImpl.java:422)
at com.intellij.openapi.components.impl.ComponentManagerImpl$ComponentsRegistry.a(ComponentManagerImpl.java:412)
at com.intellij.openapi.components.impl.ComponentManagerImpl$ComponentsRegistry.access$000(ComponentManagerImpl.java:398)
at com.intellij.openapi.components.impl.ComponentManagerImpl.a(ComponentManagerImpl.java:107)
at com.intellij.openapi.components.impl.ComponentManagerImpl.init(ComponentManagerImpl.java:86)
at com.intellij.openapi.components.impl.stores.ApplicationStoreImpl.load(ApplicationStoreImpl.java:110)
at com.intellij.openapi.application.impl.ApplicationImpl.load(ApplicationImpl.java:510)
at com.intellij.openapi.application.impl.ApplicationImpl.load(ApplicationImpl.java:492)
at com.intellij.idea.IdeaApplication.run(IdeaApplication.java:158)
at com.intellij.idea.MainImpl$1$1$1.run(MainImpl.java:66)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:715)
at java.awt.EventQueue.access$400(EventQueue.java:82)
at java.awt.EventQueue$2.run(EventQueue.java:676)
at java.awt.EventQueue$2.run(EventQueue.java:674)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:86)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:685)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:364)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:296)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:211)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:201)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:196)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:188)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
I just installed IDEA 14. It started fine once and updated a lot of plugins. After the restart required for the plugin upgrades, this behavior surfaced.
Before I upgraded to IDEA 14, but after the upgrade to Yosemite, IDEA 13 was already showing similar crashes on startup. It mentioned different plugins though. It was complaining about the flex, GWTStudio and ideTalk plugins. Removing the offending plugin temporarily made it complain about the next.
It turns out that this was caused by OS X Yosemite's different way of setting the max open files limit. This became clear by looking at ~/Library/Logs/IntelliJIdea14, where I saw:
java.io.FileNotFoundException: /Applications/IntelliJ IDEA 14.app/Contents/plugins/devkit/lib/devkit.jar (Too many open files)
It was fixed by adding a /Library/LaunchDaemons/limit.maxfiles.plist file as described on http://docs.basho.com/riak/latest/ops/tuning/open-files-limit/#Mac-OS-X.

How to change Eclipse-Groovy plugin Groovy libraries?

I am using the newest version (2.8.0) of the Eclipse-Groovy plugin that ships with groovy-all-2.1.5.jar. I added Guice to my Groovy project, and when I go to run them from inside Eclipse I get the following error in the console output:
Caught: java.lang.NoClassDefFoundError: org/codehaus/groovy/runtime/typehandling/ShortTypeHandling
java.lang.NoClassDefFoundError: org/codehaus/groovy/runtime/typehandling/ShortTypeHandling
at net.me.myapp.utils.restclient.RestClient.<init>(RestClient.groovy:57)
at net.me.myapp.inject.UserServiceClientModule.configure(UserServiceClientModule.groovy:34)
at com.google.inject.AbstractModule.configure(AbstractModule.java:59)
at com.google.inject.spi.Elements$RecordingBinder.install(Elements.java:223)
at com.google.inject.spi.Elements.getElements(Elements.java:101)
at com.google.inject.internal.InjectorShell$Builder.build(InjectorShell.java:133)
at com.google.inject.internal.InternalInjectorCreator.build(InternalInjectorCreator.java:103)
at com.google.inject.Guice.createInjector(Guice.java:95)
at com.google.inject.Guice.createInjector(Guice.java:72)
at com.google.inject.Guice.createInjector(Guice.java:62)
at net.me.myapp.UserServiceClient.<init>(UserServiceClient.groovy:37)
at net.me.myapp.UserServiceClient.main(UserServiceClient.groovy:45)
Caused by: java.lang.ClassNotFoundException: org.codehaus.groovy.runtime.typehandling.ShortTypeHandling
... 12 more
According to this answer it's because ShortTypeHandling wasn't added until 2.3.x. So I would now like to attach groovy-all-2.3.3.jar to my Eclipse project's classpath.
The problem is that I don't seem to have edit permissions to change what library the Groovy Libraries library uses under the hood. And when I manually add the 2.3.3 JAR to my build path, I get the following error:
Caught: java.lang.ExceptionInInitializerError
java.lang.ExceptionInInitializerError
Caused by: groovy.lang.GroovyRuntimeException: Conflicting module versions. Module [groovy-all is loaded in version 2.1.5 and you are trying to load version 2.3.3
What are my options?
Groovy-eclipse versions have its own compilers and are "locked" to them. You may change the versions to whatever is listed under Window > Preferences > Groovy > Compilers, but, AFAIK, you can't change to an arbitrary version of the compiler by simply changing the groovy-all jar in the guts of the plugin dir.
You can install new compiler versions using the update site or eclipse marketplace
Update: install additional compiler versions through Help > Install new Software, select Groovy update site and expand the Extra Groovy Compilers session:
Note i'm using snapshot update site, because i like to live dangerously.