GWT Compilation Failed in new GWT 7 from existing Old project - java

Hi I have updated my Eclipse Kepler to Oxygen, and GWT 2.6.1 to GWT 2.7 and java 7 to java 8 using this link.
Then I created one sample project which runs successfully.
When I added my existing project into new Eclipse Oxygen then I get the following error:
Super Dev Mode starting up
Finding entry point classes
Tracing compile failure path for type
'com.slicktechnologies.client.Slick_Erp'
[ERROR] Errors in 'file:/C:/Vijay/2017/FROM%20OXGEN%20ECLIPSE%2010%20AUGUST%202017%20ONWORDS/10%20august%202017/Slick%20Erp/src/com/slicktechnologies/client/Slick_Erp.java'
Any help would be appreciated.
As i Compiled with Log debug then error is :-
`Loading inherited module 'com.slicktechnologies.Slick_Erp'
Module location: file:/C:/Vijay/2017/FROM%20OXGEN%20ECLIPSE%2010%20AUGUST%202017%20ONWORDS/10%20august%202017/Slick%20Erp/src/com/slicktechnologies/Slick_Erp.gwt.xml
Checking for updates
Failed to obtain current version info via HTTP
Loading inherited module 'com.google.gwt.core.Core'
Module location: jar:file:/C:/Vijay/2017/NEW%20ECLIPSE%20Settings/eclipse/plugins/com.gwtplugins.gwt.eclipse.sdkbundle.gwt27_2.7.0.201707251900/gwt-2.7.0/gwt-user.jar!/com/google/gwt/core/Core.gwt.xml
Loading inherited module 'com.google.gwt.dev.jjs.intrinsic.Intrinsic'
Module location: jar:file:/C:/Vijay/2017/NEW%20ECLIPSE%20Settings/eclipse/plugins/com.gwtplugins.gwt.eclipse.sdkbundle.gwt27_2.7.0.201707251900/gwt-2.7.0/gwt-dev.jar!/com/google/gwt/dev/jjs/intrinsic/Intrinsic.gwt.xml
Loading inherited module 'com.google.gwt.lang.LongLib'
Module location: jar:file:/C:/Vijay/2017/NEW%20ECLIPSE%20Settings/eclipse/plugins/com.gwtplugins.gwt.eclipse.sdkbundle.gwt27_2.7.0.201707251900/gwt-2.7.0/gwt-dev.jar!/com/google/gwt/lang/LongLib.gwt.xml
Loading inherited module 'com.google.gwt.core.CompilerParameters'
Module location: jar:file:/C:/Vijay/2017/NEW%20ECLIPSE%20Settings/eclipse/plugins/com.gwtplugins.gwt.eclipse.sdkbundle.gwt27_2.7.0.201707251900/gwt-2.7.0/gwt-user.jar!/com/google/gwt/core/CompilerParameters.gwt.xml
`

Related

Tycho can't resolve indirectly referenced SWT dependencies

The problem is probably the same as in this question, but the solution offered there has become inapplicable in the last 8 years.
I have an Eclipse RCP project which is in the process of being transformed to use Tycho (version 2.3.0) instead. The project can be run with Eclipse 2019-06 and the custom target platform built for this project.
Then I have set up Tycho with the same target platform (a separate Maven module referencing the same *.target file used by Eclipse).
But then when I run Maven (version 3.6.3) with the usual "clean install" goals, I get this error message:
[ERROR] Failed to execute goal org.eclipse.tycho:tycho-compiler-plugin:2.3.0:compile (default-compile) on project my.project.module: Compilation failure: Compilation failure:
[ERROR] C:\path\to\a\source\file\in\a\module.java:
[ERROR] /*
[ERROR] ^
[ERROR] The type org.eclipse.swt.widgets.Event cannot be resolved. It is indirectly referenced from required .class files
The target platform specifies the same environment (win32.win32.x86_64) for both Eclipse and Tycho, and both SWT .jar files (org.eclipse.swt_3.111.0.v20190605-1801.jar and org.eclipse.swt.win32.win32.x86_64_3.111.0.v20190605-1801.jar) are in one of the directories making up the target platform.
After adding
jars.extra.classpath = platform:/plugin/org.eclipse.swt.win32.win32.x86_64
to the build.properties file (as recommended here) the problem is gone.

Java 11 unnamed module issue when using Maven model

So, I'm trying to migrate a tool from Java 8 to Java 11.
I did the first step to make it work without modules and the code compiles successfully.
Now I'm trying to add the module-info.java, and I first faced issues because of the libraries used in my tool. Some are already compatible with Java 11 (e.g. Lombok) but some others are not, so I'm trying to import them using the requires and the artifactId name.
But I seem stuck because of my Maven model & Maven model builder dependency as I get the following error when building:
[ERROR] the unnamed module reads package org.apache.maven.model.merge from both maven.model.builder and maven.model
[ERROR] module maven.model.builder reads package org.apache.maven.model.merge from both maven.model.builder and maven.model
[ERROR] module maven.model reads package org.apache.maven.model.merge from both maven.model.builder and maven.model
What should I do for this kind of error? It seems I need both (build still fails if I comment one or the other). Does it mean I cannot add modules to my tool because of my dependencies?
N.B.: The libraries are set to their latest version (i.e. 3.6.3)
I "fixed" this using the maven-exec-plugin as described in the answer to this question.
Edit: When running the main class through the maven-exec-plugin, the compiler does (for some reason unknown to me) not complain anymore about the conflicts.

Fix java.lang.module.ResolutionException: two modules export the same package to another module in a non-modular app

I'm trying to build a non-modular application (no module-info.java files) with JavaFX 11 using Maven.
As suggested on openjfx.io, I'm using JavaFX Maven plugin for that.
But in respond to mvn javafx:run I get the following error:
[INFO] --- javafx-maven-plugin:0.0.2:run (default-cli) # server ---
Error occurred during initialization of boot layer
java.lang.module.ResolutionException: Modules lucene.core and
lucene.misc export package org.apache.lucene.store to module javassist
[ERROR] Command execution failed.
I'm using Hibernate Search 5.11.2 which depends on org.apache.lucene:lucene-core:5.5.5 and org.apache.lucene:lucene-misc:5.5.5.
As far as I understand from the API, these jars are simple pre-JDK9 jars. So they should be parts of the unnamed module and I should get no errors.
Or am I missing something?
Fixed in this PR.
So either build and install the snapshot or wait until version 0.0.3 will be released, if you are facing the similar issue.
Faced this in javafx-maven-plugin 0.0.5 with IntelliJ
Kept getting different errors like :
Error occurred during initialization of boot layer
java.lang.module.ResolutionException: Modules plexus.archiver and plexus.io export package org.codehaus.plexus.components.io.resources to module j2objc.annotations
Had to clear all libraries (except org.javafx) from the Module Settings and rebuild the project, which finally fixed the issue.

Java 11 JLink getting error: automatic module cannot be used with jlink: com.microsoft.sqlserver.jdbc from file

I'm trying to add a JDBC connector module to my project with Java 11. I downloaded the MSSqlServer JDBC driver 7.2 for Java 11
https://www.microsoft.com/en-us/download/details.aspx?id=57782
I added the module :
requires com.microsoft.sqlserver.jdbc;
Yet when I try to clean+build, NetBeans tells me:
Error: automatic module cannot be used with jlink: com.microsoft.sqlserver.jdbc from file: /sqljdbc_7.2/enu/mssql-jdbc-7.2.2.jre11.jar
I'm pretty sure this is because the jar doesn't have a compiled module-info.java. However, I was wondering if there is a way to inject one in there?

How to upgrade to Java 11 without modules?

When I try to build my project with Maven 3.5.4 and Java 11.0.2, the build fails with the message:
Compilation failure: Compilation failure: [ERROR]
xx/directory/krb5/KerberosContextSource.java:[38,20] package
sun.security.krb5 is not visible [ERROR] (package sun.security.krb5
is declared in module java.security.jgss, which does not export it to
the unnamed module)
I have read from several sources that it's not necessary to modularise your project to upgrade it to Java 9+.
Why do I still run into this issue which clearly asks me to define a module-info.java? As mentioned here.
How do I get around it?

Categories