Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [tycho-user] Build is failing when switching to Java 11

I found a submitted bug and a workaround. Apparently, when a compiler release number is passed to javac, it can cause strange errors like what I sent. I was able to resolve the issue by changing my root pom to have these properties:

<properties>
    <tycho.version>2.1.0</tycho.version>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <maven.compiler.target>11</maven.compiler.target>
    <maven.compiler.source>11</maven.compiler.source>
    <maven.compiler.release />
</properties>


On Wed, Nov 18, 2020 at 3:59 AM Aleksandar Kurtakov <akurtako@xxxxxxxxxx> wrote:
Can you share a reproducer? Also please make sure you use latest Tycho version in your build as there have been a number of fixes improving work with modular JVM.

On Wed, Nov 18, 2020 at 7:01 AM Kenneth Keefe <kjkeefe@xxxxxxxxxxxx> wrote:
I am working on upgrading my e4 RCP application to Java 11. All the plugins and features compile just fine in the IDE and I can export the product and run it. I'm trying to get the Tycho build working again with the new java version. Unfortunately, I'm getting some strange errors that I can't make sense of. It is almost as if there are two versions of java be used and they are clashing. 

Any suggestions for how to debug these errors?

Thanks,
Ken


[ERROR] Failed to execute goal org.eclipse.tycho:tycho-compiler-plugin:2.1.0:compile (default-compile) on project com.example.core.util: Compilation failure: Compilation failure:
[ERROR] /Users/ken/gitlab/mainExample/bundles/com.example.core.util/src/com/example/core/util/saving/OldSaveFileReader.java:[1559]
[ERROR] TheWriteMethod = Current.getClass().getMethod("readObject", ClassParameterArray);
[ERROR]                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[ERROR] Type mismatch: cannot convert from Method to Method
[ERROR] /Users/ken/gitlab/mainExample/bundles/com.example.core.util/src/com/example/core/util/SWTResourceManager.java:[162]
[ERROR] image = getImage(clazz.getResourceAsStream(path));
[ERROR]        ^^^^^^^^
[ERROR] The method getImage(java.io.InputStream) in the type SWTResourceManager is not applicable for the arguments (java.io.InputStream)
[ERROR] /Users/ken/gitlab/mainExample/bundles/com.example.core.util/src/com/example/core/util/ResourceManager.java:[370]
[ERROR] Method getBundleMethod = BundleContextClass.getMethod("getBundle", new Class[0]); //$NON-NLS-1$
[ERROR]                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[ERROR] Type mismatch: cannot convert from Method to Method
[ERROR] /Users/ken/gitlab/mainExample/bundles/com.example.core.util/src/com/example/core/util/ResourceManager.java:[374]
[ERROR] Constructor<?> pathConstructor = PathClass.getConstructor(new Class[]{String.class});
[ERROR]                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[ERROR] Type mismatch: cannot convert from Constructor<capture#8-of ?> to Constructor<?>
[ERROR] /Users/ken/gitlab/mainExample/bundles/com.example.core.util/src/com/example/core/util/ResourceManager.java:[379]
[ERROR] Method findMethod = PlatformClass.getMethod("find", new Class[]{BundleClass, IPathClass}); //$NON-NLS-1$
[ERROR]                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[ERROR] Type mismatch: cannot convert from Method to Method
[ERROR] /Users/ken/gitlab/mainExample/bundles/com.example.core.util/src/com/example/core/util/ResourceManager.java:[391]
[ERROR] Constructor<?> pathConstructor = PathClass.getConstructor(new Class[]{String.class});
[ERROR]                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[ERROR] Type mismatch: cannot convert from Constructor<capture#19-of ?> to Constructor<?>
[ERROR] /Users/ken/gitlab/mainExample/bundles/com.example.core.util/src/com/example/core/util/ResourceManager.java:[395]
[ERROR] Method findMethod = PluginClass.getMethod("find", new Class[]{IPathClass}); //$NON-NLS-1$
[ERROR]                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[ERROR] Type mismatch: cannot convert from Method to Method
[ERROR] /Users/ken/gitlab/mainExample/bundles/com.example.core.util/src/com/example/core/util/saving/OldSaveFileWriter.java:[825]
[ERROR] TheWriteMethod = Current.getClass().getMethod("writeObject", ClassParameterArray);
[ERROR]                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[ERROR] Type mismatch: cannot convert from Method to Method
[ERROR] 8 problems (8 errors)
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR]   mvn <args> -rf :com.example.core.util
_______________________________________________
tycho-user mailing list
tycho-user@xxxxxxxxxxx
To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/tycho-user


--
Alexander Kurtakov
Red Hat Eclipse Team
_______________________________________________
tycho-user mailing list
tycho-user@xxxxxxxxxxx
To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/tycho-user


--
-------
Ken Keefe
Senior Software Engineer
Information Trust Institute
University of Illinois at Urbana-Champaign
1308 W. Main St.
CSL 225
Urbana, Illinois 61801, USA
Phone: 217-244-3203


Back to the top