Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » e(fx)clipse » Maven cannot compile application(The type java.lang.Object cannot be resolved. It is indirectly referenced from required .class files)
Maven cannot compile application [message #1784871] Thu, 05 April 2018 03:05 Go to next message
Marcelo Ruiz is currently offline Marcelo RuizFriend
Messages: 80
Registered: April 2017
Member
Hi,
I was really annoyed with random errors in the editor so I decided to start completely from scratch. I made a backup of my project and erased everything else (eclipse, the eclipse configuration, and the workspace).
I downloaded and installed Eclipse Oxygen.3 (4.7.3) and then installed e(fx)clipse 3.2.0 on top of it. I also created the Run Target based on the e(fx)clipse 3.2.0 runtime.
I then used the wizard to create a new JavaFX OSGI e4 Application Project. Filled in the required information, and edited Application.e4xmi to add a trimmed window with a size of 1024x768.
I run the application as com.test.app.product.product and the window is shown as expected.
The problem comes when I open a console in the workspace folder and type:

mvn clean compile -f com.test.app.releng/pom.xml


Then I get:

 Failed to execute goal org.eclipse.tycho:tycho-compiler-plugin:1.0.0:compile (default-compile) on project com.test.app: Compilation failure: Compilation failure: 
[ERROR] /home/marcelo/eclipse-workspace/com.test.app/src/com/test/app/themes/DefaultTheme.java:[1] 
[ERROR] 	package com.test.app.themes;
[ERROR] 	^
[ERROR] The type java.lang.Object cannot be resolved. It is indirectly referenced from required .class files
[ERROR] /home/marcelo/eclipse-workspace/com.test.app/src/com/test/app/themes/DefaultTheme.java:[1] 
[ERROR] 	package com.test.app.themes;
[ERROR] 	^
[ERROR] The type java.lang.String cannot be resolved. It is indirectly referenced from required .class files
[ERROR] /home/marcelo/eclipse-workspace/com.test.app/src/com/test/app/themes/DefaultTheme.java:[1] 
[ERROR] 	package com.test.app.themes;
[ERROR] 	^
[ERROR] The type java.lang.Class cannot be resolved. It is indirectly referenced from required .class files
[ERROR] /home/marcelo/eclipse-workspace/com.test.app/src/com/test/app/themes/DefaultTheme.java:[5] 
[ERROR] 	public class DefaultTheme extends AbstractTheme {
[ERROR] 	             ^^^^^^^^^^^^
[ERROR] The hierarchy of the type DefaultTheme is inconsistent
[ERROR] /home/marcelo/eclipse-workspace/com.test.app/src/com/test/app/themes/DefaultTheme.java:[5] 
[ERROR] 	public class DefaultTheme extends AbstractTheme {
[ERROR] 	                                  ^^^^^^^^^^^^^
[ERROR] The type javafx.collections.ListChangeListener$Change cannot be resolved. It is indirectly referenced from required .class files
[ERROR] /home/marcelo/eclipse-workspace/com.test.app/src/com/test/app/themes/DefaultTheme.java:[7] 
[ERROR] 	super("theme.default", "Default theme", DefaultTheme.class.getClassLoader().getResource("css/default.css"));
[ERROR] 	                                        ^^^^^^^^^^^^^^^^^^
[ERROR] Class<DefaultTheme> cannot be resolved to a type
[ERROR] 6 problems (6 errors)
[ERROR] -> [Help 1]


How do I solve this? Shouldn't this work right away?
I read many forums wasting a complete day and trying many suggestions. The most common one is to go to the project's properties, java build path, libraries, delete the JRE System Library and add it again in every possible way: defined as Execution Environment, as Alternate JRE and as Workspace default JRE). Nothing works.
Any ideas on how to solve this?
Thanks!


Re: Maven cannot compile application [message #1784889 is a reply to message #1784871] Thu, 05 April 2018 08:30 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
yes it should and does work. What's the host java you running maven with? Is it probably Java9?
Re: Maven cannot compile application [message #1784925 is a reply to message #1784889] Thu, 05 April 2018 20:48 Go to previous message
Marcelo Ruiz is currently offline Marcelo RuizFriend
Messages: 80
Registered: April 2017
Member
Hi Tom,
Thanks for getting back to me. I just logged in to update the answer with the solution: this actually happens with Java 9, so upgrading tycho's version to 1.1.0 solves the problem.
Maybe it will be a good idea to update the e4 project template so it uses 1.1.0 instead of 1.0.0?
Previous Topic:Problems in the editor with java fx classes
Next Topic:JavaFX in PlugIn project.
Goto Forum:
  


Current Time: Tue Dec 10 09:36:07 GMT 2024

Powered by FUDForum. Page generated in 0.04229 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top