How to upgrade to Java 11 without modules? - java

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?

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.

maven project build shows Compilation failure

I am creating a web application using spring mvc with eclipse as my IDE and every time I build my project I keep getting getting the following :- Compilation failure: Compilation failure:
[ERROR] /C:/Users/dev1/project/GeoVision/src/main/java/com/mmi/controllers/GeoJsonToShp.java diamond operator is not supported in -source 1.5
I have changed the java build path and set it to latest JRE and even then the error won't go.
Also, I am able to run the project on server?
Please suggest what is it that I have to change to successfully build my project?
You need to configure the compile level in IDE settings
Or configure the maven file (probably this rather than eclipse)

GWT Compilation Failed in new GWT 7 from existing Old project

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
`

com.apple.AppleJavaExtensions AboutHandler class not found

I'm trying to compile my java project with maven, but every time i got this error:
ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.6.1:compile (default-compile) on project tts: Compilation failure: Compilation failure:
[ERROR] /Users/stefano/Programming/git/DyslexoTTS/src/main/java/io/dyslexo/graphics/Tray.java:[3,22] cannot find symbol
[ERROR] symbol: class AboutHandler
[ERROR] location: package com.apple.eawt
On intelliJ I have no issues, why maven does not work?
Here the piece of code:
Application application = Application.getApplication();
application.setAboutHandler(e -> {
//my code
});
I also tried to compile on different platforms like linux and windows, but i got the same error.
How can I fix that?
I also tried to compile on different platforms like linux and windows,
but i got the same error. How can I fix that?
You'll have to add a stub library since those classes aren't available on non-Mac platforms. AppleJavaExtensions is one example. Put it in your compilation classpath, but be sure not to include it in the final product, assuming those classes will be available runtime.

JDK8u20 compilation error with provided dependency

I use maven (3.2.1) to build our project. My project depends on some propretiary libraries that we have in local maven repo. Those libraries are declared with provided scope (because we don't need them in distribution). Our dependencies depends, of course, on some other libs, e.g. apache-scxml lib, but our code don't do anything with any class from apache-scxml. And in JDK8u20 we cannot build our system anymore, it fails with exception:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile (default-compile) on project <myproject>: Compilation failure
[ERROR] <myclass>.java:[47,45] error: cannot access SCXMLListener
But project builds completely fine with JDK8u5 and JDK8u11.
I tried to find some info and only thing I found is here: https://issues.jboss.org/browse/FORGE-2019
but I don't think its the same, or at least I cannot understand it. Can someone explain to me what can be the reason that it compiles with JDK8u11 and not with u20?

Categories