Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » GEF4 Setup Error - FXCanvas cannot be resolved to a type
GEF4 Setup Error - FXCanvas cannot be resolved to a type [message #1701814] Wed, 15 July 2015 23:37 Go to next message
Patrik Suzzi is currently offline Patrik SuzziFriend
Messages: 2
Registered: February 2018
Junior Member
Hallo,

I tried to setup the development environment for GEF4, as specified in the GEF Contributor guide, and I found the following error:

FXCanvas cannot be resolved to a type.
(se attached file)

This error is persistent, and it seems i am not able to find a solution despite I tried multiple times to setup the environment, as specified in the GEF/GEF4 contributor guide .

This is the list of steps I followed for the setup


  1. Check Java 8 (oracle) is installed, that is required by the e(fx)clipse plugin.
  2. Download Eclipse IDE for Eclipse Committers. In my case: eclipse-committers-mars-R-win32.zip
  3. Install plugins needed by GEF4, in my case:

    1. e(fx)clipse - IDE, from http://download.eclipse.org/efxclipse/simrel-contrib/mars/m7/tools/site
    2. e(fx)clipse - IDE - PDE, from http://download.eclipse.org/efxclipse/simrel-contrib/mars/m7/tools/site
    3. API Tools Execution Environment Descriptions, from: http://download.eclipse.org/eclipse/updates/4.5-I-builds
    4. Oomph Version Management, from: http://download.eclipse.org/releases/mars'
    5. Maven Integration for Eclipse (includes Incubating components), from: http://download.eclipse.org/releases/mars

  4. Clone the GEF4 Git repository and import the projects in the workspace
  5. Set MARS.target: from org.eclipse.gef4.target project, double click the target definition, wait for the target is fully resolved, and click on "set as target platform".
  6. Adjust preferences. select Menu > Window > Preferences:

    1. Java > Compiler > Errors/Warnings: ignore the "Deprecated and restricted API"
    2. Plug-in Development > Compilers: Ignore the "References to discouraged classes"



At the end of the setup, I can not compile the GEF4 project, because "FXCanvas cannot be resolved to a type. "
See image.
index.php/fa/22519/0/

Does anyone has an idea on how to fix this ?

Kind Regards.
Patrik

[Updated on: Wed, 15 July 2015 23:39] by Moderator

Report message to a moderator

Re: GEF4 Setup Error - FXCanvas cannot be resolved to a type [message #1701828 is a reply to message #1701814] Thu, 16 July 2015 04:49 Go to previous messageGo to next message
Alexander Nyssen is currently offline Alexander NyssenFriend
Messages: 244
Registered: July 2009
Location: Lünen
Senior Member
It seems the javafx-swt-integration was not added to the classpath by e(fx)clipse. Please make sure you literally follow the section about "Specify Execution Environment for J2SE-1.7 (and optionally J2SE-1.8)" from the contributor guide.
Re: GEF4 Setup Error - FXCanvas cannot be resolved to a type [message #1701835 is a reply to message #1701828] Thu, 16 July 2015 06:46 Go to previous messageGo to next message
Alexander Nyssen is currently offline Alexander NyssenFriend
Messages: 244
Registered: July 2009
Location: Lünen
Senior Member
I updated the respective section of the contributor guide to make it even more explicit, why the "Specify Execution Environment for J2SE-1.7 (and optionally J2SE-1.8)" is important. I also saw that the guide still listed the e(fx)clipse 2.0.0 Mars M7 contribution. I updated it to refer to the e(fx)clipse 2.0.0 Mars release. You might want to update your IDE accordingly.
Re: GEF4 Setup Error - FXCanvas cannot be resolved to a type [message #1734379 is a reply to message #1701835] Tue, 07 June 2016 17:03 Go to previous messageGo to next message
Alex B. is currently offline Alex B.Friend
Messages: 20
Registered: June 2016
Junior Member
Hi there,

unfortunately I am facing the same problem as described by Patrik. I performed pretty much the same steps as him in order to set up the environment. It just differs in the following points:
Eclipse Version: Mars (4.5.2)
e(fx)clipse - IDE 2.1.0
Both are working with a JDK 1.8 x64 so far.

After checking out the sources from https://github.com/eclipse/gef4 and importing them as separated project in Eclipse I receive the error that "FXCanvas cannot be resolved to a type. " As mentioned in the adopter guidelines, I did not manually import the jfxrt.jar, since it is assumed to be imported automatically. Maybe anyone can give me a hint how to fix this?

Thanks
Alex
Re: GEF4 Setup Error - FXCanvas cannot be resolved to a type [message #1734937 is a reply to message #1701814] Mon, 13 June 2016 23:09 Go to previous messageGo to next message
Marco Ho is currently offline Marco HoFriend
Messages: 3
Registered: June 2016
Junior Member
Hello!

I have a very similar issue.

I've already built part of an MVC application, similar to the logo example, everything worked rather well so far, except things that require javafx.embed.

I've been trying to get the SWT examples from the GEF4 repository to run.
This is what happens:
Exception in thread "main" java.lang.Error: Unresolved compilation problems: 
	The import javafx.embed.swt cannot be resolved
	The import javafx.embed.swt cannot be resolved
	Javadoc: FXCanvas cannot be resolved to a type
	FXCanvas cannot be resolved to a type


i'm running Neon (is this a bad idea? should i go back to mars?) , followed the instructions on the adopters guide as best as i could. e(fx)clipse PDE is installed in its newest version ().

i've added Quote:

-vm
C:\Program Files\Java\jre1.8.0_71\bin\javaw.exe

to the eclipse.ini, which didn't solve this issue.

I'm not very experienced with eclipse and its settings.
if there is a way to manually add required jars to fix this, that solution would be enough for me for now, but i haven't been able to get it to work.

any help would be much appreciated.

  • Attachment: fx.png
    (Size: 89.54KB, Downloaded 213 times)
Re: GEF4 Setup Error - FXCanvas cannot be resolved to a type [message #1735189 is a reply to message #1734937] Thu, 16 June 2016 08:40 Go to previous message
Matthias Wienand is currently offline Matthias WienandFriend
Messages: 230
Registered: March 2015
Senior Member
Hi Marco,

please ensure that you precisely followed the instructions given in the adopter guide [1]. It is important that the execution environments for JavaSE-1.7 and JavaSE-1.8 are defined.

Best regards,
Matthias

[1] wiki.eclipse.org/GEF/Adopter_Guide
Previous Topic:[GEF4] Possible memory leak in SelectionBehavior.updateHandles()
Next Topic:[GEF4] Calculation of stroke outline in model
Goto Forum:
  


Current Time: Thu Sep 19 12:14:40 GMT 2024

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

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

Back to the top