Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[tycho-user] NullPointerException with Java 9 and Tycho 1.1.0


I've started migrating our projects to Java 9 / Tycho 1.1.0 and now I get a NullPointerException during compilation.

[ERROR] Failed to execute goal org.eclipse.tycho:tycho-compiler-plugin:1.1.0:compile (default-compile) on project Compilation failure: Compilation failure:
[ERROR] D:\workspace\parent_project\my_project\src\main\java\my\project\name\
[ERROR] package;
[ERROR] Internal compiler error: java.lang.NullPointerException at org.eclipse.jdt.internal.compiler.lookup.BinaryModuleBinding.create(
[ERROR] java.lang.NullPointerException
[ERROR] at org.eclipse.jdt.internal.compiler.lookup.BinaryModuleBinding.create(
[ERROR] at org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment.getModuleFromAnswer(
[ERROR] at org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment.askForTypeFromModules(
[ERROR] at org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment.askForType(
[ERROR] at org.eclipse.jdt.internal.compiler.lookup.UnresolvedReferenceBinding.resolve(
[ERROR] at org.eclipse.jdt.internal.compiler.lookup.BinaryTypeBinding.resolveType(
[ERROR] at org.eclipse.jdt.internal.compiler.lookup.PackageBinding.getTypeOrPackage(
[ERROR] at org.eclipse.jdt.internal.compiler.lookup.CompilationUnitScope.findImport(
[ERROR] at org.eclipse.jdt.internal.compiler.lookup.CompilationUnitScope.findSingleImport(
[ERROR] at org.eclipse.jdt.internal.compiler.lookup.CompilationUnitScope.faultInImports(
[ERROR] at org.eclipse.jdt.internal.compiler.lookup.CompilationUnitScope.faultInTypes(
[ERROR] at org.eclipse.jdt.internal.compiler.Compiler.process(
[ERROR] at
[ERROR] at java.base/

Strangely, the project where the compilation fails is not the first submodule - the first five or six submodules compile perfectly fine and then on this module the compiler crashes.

To get closer to the source of the problem I tried the following:

- I manually forced tycho-compiler-plugin to use the previous version of JDT


I am aware that even if this had worked, it would be a suboptimal solution, but it was worth a try. When I ran the tycho build in an existing workspace, this configuration actually worked! But on a clean workspace it failed and complained about Fatal error compiling: Compliance level '1.4' is incompatible with target level '9'. A compliance level '9' or better is required because in the clean workspace there exist no .settings/org.eclipse.jdt.core.prefs. As ultimately I'd like my projects to compile with "standard" tycho anyway, I did not follow this path further.

- I discovered that the actual JDT version used by the current tycho release is 3.14.0.v20171206-0802 and downloaded a fresh eclipse that comes with exactly this JDT version.

This is the case for eclipse photon M4 (M5 already comes with JDT version 3.15), so I downloaded it and imported my projects. Eclipse does not report an error and also all JUnit-Tests that use the above mentioned project run fine.
Actually I had hoped that I could reproduce the error in that eclipse version and that I could use that to find a solution (maybe it's a project misconfiguration or similar).

I'm a bit clueless on how to progress from here and what I could try to pin down the problem further. Please remember that it's not a general problem but several submodules compile without exception. I could not find an obvious configuration difference between the working modules and the crashing one.

Does anyone have an idea how to progress? I'm asking here first because everything seemed to work fine from within eclipse itself. If you need further information to tackle the problem, I'll be glad to provide it.


Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

Back to the top