GWT hello world app does not compile and asks for 'com.google.gwt.core.Core' - eclipse

I haven't done GWT development for a while and wanted to try again. In my Windows 10, I installed JDK 12 and Eclipse 2019-03. I installed GWT Eclipse Plugin (GWT 2.8.1).
From Eclipse, I created a hello world project this way:
Click on 'New GWT Application Project'
Project name: Gwt5, Package: com.foo, Use default SDK (GWT 2.8.1)
Click on 'GWT Compile Project'
I see this error:
Compiling module com.foo.Gwt5
[ERROR] Hint: Check that your module inherits 'com.google.gwt.core.Core' either directly or indirectly (most often by inheriting module 'com.google.gwt.user.User')
I didn't change my gwt.xml. I checked and "com.google.gwt.user.User" is there.
Any suggestion?

When language compliance level or JRE is set to higher than what GWT supports, this error occurs (The error message is not very helpful though).
As of May 2019, GWT supports only up to Java 8, and that is provided by JDK 1.8. For example, to make GWT work with Oracle's JDK, you need to download an older version of JDK (Java SE), than set both the Compiler compliance level and Installed JRE to:
Compiler compliance level: 1.8
JRE Home: C:\Program Files\Java\jdk1.8.0_202\

Related

export with jdk 8 still got error when start server

I used eclipse with jdk 8 to export to jar. Yet i still get this error when start my server sfs
Exception in thread "main" java.lang.UnsupportedClassVersionError: sfs2x/extension/mmo/MMORoomDemoExtension$NPCData has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0
Could someone tell me how to fix.
I tried to uninstalled all java and install jdk8 only. But nothing change.
I had a similar problem, what fixed it for me was making sure that jdk8 was selected as the build jdk for that project (right click on your project in Eclipse and click on properties -> Java build path -> JRE System Libraries -> Workspace Default JRE, make ure that jdk8 is selected) and then recompiling. I was able to delete all .class files before recompiling as well, but that may be difficult if this is a project.
Best of luck.

Error running simple program in NetBeans 9.0

I'm trying to use NetBeans for a JDBC project. However, I'm getting runtime errors when I try to compile. I decided to try a "hello world" project and I couldn't get that to run also. I'm in NetBeans 9.0 with Java JDK 10.0.2.
Error Message:
Exception in thread "main" java.lang.RuntimeException:
at javaapplication2.JavaApplication2.main(JavaApplication2.java:1)
C:\Users\James\AppData\Local\NetBeans\Cache\dev\executor-snippets\run.xml:111: The following error occurred while executing this line:
C:\Users\James\AppData\Local\NetBeans\Cache\dev\executor-snippets\run.xml:68: Java returned: 1
BUILD FAILED (total time: 1 second)
xml debug:<call-java classname="#{classname}" classpath="#{classpath}" modulename="#{modulename}" modulepath="#{modulepath}">
package javaapplication2;
public class JavaApplication2 {
public static void main(String[] args) {
System.out.println("Hello");
}
}
It is very easy, your JDK version is not 100 % compatible; use version 8.2, which is the most stable for Arduino and others.
To change platforms without deleting the existing one, simply go to Tools / Java Platforms / click on the button add Platforms.
Download/install JDK major version number the same as NetBeans.
i.e. If You have NetBeans 9 version, but your JDK is version 10,So try use NetBeans 10 version... or download/install JDK 9 (the same as NetBeans).
Create new java platform for new jdk installation.
Open netbeans menubar->tools->Java Platforms->Add Platform Specify the folder that contains the Java platform as well as the sources and Javadoc needed for debugging.
Set new java platform to your project
Right click on project ->properties->Libraries->Java Platform->select the jdk version that same as NetBeans.
Select source format of your project
Right click on project ->properties->Sources->Sources/binary format->select the jdk version that same as NetBeans.
If it still give same error,Open the project properties, select the Build-Compiling, uncheck "Compile on save" and rerun the application. This will make sure all your source code becomes recompiled before running it.

Playframework 2.3.6 reactive-stocks-java8 template issue in eclipse Luna

I have a problem using Eclipse as IDE for the reactive-stocks-java8 template coming with typesafe-activator-1.2.10
Here are my steps:
Install Eclipse Luna on my Mac.
Default JRE is 1.6, but I have the oracle JDK in /Library/Java/JavaVirtualMachines/jdk1.8.0_25.jdk/Contents/Home/ after installing with the standard method. I add this JRE to the alternate JRE of eclipse
Install activator
I've downloaded typesafe-activator-1.2.10.zip, unzip it in a folder, add it to the path to have activator in the command line.
Create the project
$activator new
> reactive-stocks-java8
$cd reactive-stocks-java8/
$java -version
java version "1.8.0_25"
Java(TM) SE Runtime Environment (build 1.8.0_25-b17)
Java HotSpot(TM) 64-Bit Server VM (build 25.25-b02, mixed mode)
$activator
[reactive-stocks-java8] $eclipse with-source=true
In eclipse
I import the project in the standard way (Import / Existing Project into Workspace)
in the java build path, The JRE is the 1.6. I change it to 1.8.0_25
I also have to change the java compiler
In my package explorer or the Problems view, no compilation error, great. Now I click on app/controller/Application.java to open it in the editor. In the editor, I've got some unresolved:
views.html.index cannot be resolved to a type
The type scala.collection.Seq cannot be resolved. It is indirectly referenced from required .class files
What am I missing?
here are the answers from the community
https://groups.google.com/forum/#!topic/play-framework/v6ep7DmfH18

e(fx)clipse 0.9.0 on Kepler with Java 7

is it possible to run the e(fx)clipse sample application on Kepler & Java7 at all ?
I took the steps, descripted in tutorial 4 to integrate the target definition(s)
https://wiki.eclipse.org/Efxclipse/Tutorials/Tutorial4
I tried the all-in-one-eclipse as well as upgrading a common kepler-eclipse with update-site http://download.eclipse.org/efxclipse/updates-released/0.9.0/site
However, the Sample Project JavaFX/Samples/e4 Media Application can not be compiled.
With Target Definition "RCP 3x Platform", all! application dependencies can not be resolved
With Target Definition "Target Platform Feature" a warning comes up, that the target version is newer than my current Eclipse installation. There are no comile errors anymore, but running the app I will get a lot of runtime errors like:
Unresolved requirement: Require-Capability: osgi.ee; filter:="(&(osgi.ee=JavaSE)(version=1.8))"
Did anybody get the sample "e4 Media Application" working ?
My Eclipse: Kepler Service Release 2
My Java: JDK 7u40
============== EDIT ==============
Got it working, thanks to Tom!
Install fresh new Eclipse: http:// www.eclipse.org/downloads/packages/eclipse-rcp-and-rap-developers/keplersr2
Install Xtext 2.5.0, Update-Site: http:// download.eclipse.org/modeling/tmf/xtext/updates/composite/releases
Install e(fx)clipse, Update-Site: http:// download.eclipse.org/efxclipse/updates-released/0.9.0/site
Add new Target Platform, Update-Site: http:// download.eclipse.org/efxclipse/runtime-released/0.9.0/site
Select FX Target -> Target Platform Feature
The nightly runtime site already requires Java8 (see announcement on e(fx)clipse newsrpoup!)
If you want to run it on Java7 you need to use http://download.eclipse.org/efxclipse/runtime-released/0.9.0/Site for the target platform

Drools Java 7 support in Eclipse

I created a Drools project in Eclipse (Indigo) configured to use JRE 1.7. But I get an error pointing to my .drl file:
com/sample/DroolsTest$Message : Unsupported major.minor version 51.0
The com.sample.DroolsTest.Message class is imported by the .drl file. The Drools runtime was 5.2.1 (also tried with 5.3.0.Final).
Any help would be appreciated. Thanks.
This exception doesn't seem to have to do anything with Drools in particular, but is a generic Java error. It occurs if you try to execute a Java class with a JRE that is older than the JDK that was used to compile it. For example, if you compiled the class with a JDK7 and then tried to execute it with a JDK6, you would get this error.
Just to detail above answer and comment. I had both JRE6 and JRE7 installed, with JRE7 being the default. I had to do two things to remove the error from the drools sample project.
Set the JRE for the project to 1.6
Project properties->Java Build Path->Libraries. Remove JRE System Library 1.7 and Add Library->JRE System Library->Alternate JRE->JRE6
Set the compiler compliance level for the project at 1.6.
Project properties->Java Compiler->check Enable Project specific settings and set Compiler compliance level at 1.6.