Keep Getting Error When Trying to Run Javafx on Eclipse with Mac - eclipse

So I keep getting this error when trying to run my program:
Error occurred during initialization of boot layer
java.lang.module.FindException: Module javafx.controls not found
I'm using a mac with eclipse, and my VM argument is:
--module-path /Users/myname/Desktop/javafx-sdk-11.0.2_3/lib --add-modules javafx.controls,javafx.fxml
I've tried everything, javafx.controls.jar and the other .jar file are in my lib folder. I've reinstalled the javafx program, changed my file path around hundreds of times, and I've tried to install plugins. Does anyone have any idea as too what can be happening? JavaFX is also an added library in my project, and all the .jar files assocated with it are added to it. Please let me know if anyone has an idea. Best!

I had success with the following additional step.
In the Run Configuration->Dependencies tab, click the "ModulePath" and then add the JavaFX JDK's jars (or the /lib folder that holds the jars) to the list.
You can inspect the generated command line, and check that these are included in the -p option.
IDK why this step should be needed. I would think Eclipse should be smart enough to include something on the dependency module path if it were in the project's Build Path Library list.
I have questions about this at eclipse.org and gluon. Maybe there will be an explanation, or fix so that this step isn't needed, or an edit to the documentation to let us know we need to do this.

Related

Module not found error (JavaFX) -- running a cloned repo on my Eclipse

Please help. I am trying to run an app that is cloned from a GitHub repository. I could run it fine from the terminal (with ./gradlew run (I'm using MacOS)), but if I open the project in Eclipse and run it from there, it fails. (My goal is not just to run the app on my computer but to run it from Eclipse so that I could add a feature or two in the future for personal use).
I searched for solutions all day and tried different things, but solving one error led to another.
What I've done in detail:
Open the project from "Open Projects from File System.."
Right click on the project and "Configure" -> "Add Gradle Nature" (Not sure if this is the right step to take)
Right click on project -> build path -> library -> move the "project and external dependencies" library (includes all jar files such as javafx-controls-17-mac.jar) from classpath to modulepath (This step gets rid of all errors except one within the src/test/java folder, which I believe does not directly affect running the app).
If I run the app I get the following error:
Error occurred during initialization of boot layer java.lang.module.FindException: Module javafx.controls not found
I tried adding
--module-path /Users/julie/.gradle/caches/modules-2/files-2.1/org.openjfx/javafx-controls--add-modules javafx.controls
under VM Arguments in Run Configurations but it would give me this error:
Error: Could not find or load main class javafx.controls
Caused by: java.lang.ClassNotFoundException: javafx.controls
The path is what I found by looking at "project and external dependencies" library that came with the code (provided by the author). Not sure if that's the right way to do it, but I thought it makes sense to use something within the cloned repo rather than downloading a new javafx and use that path.
I've tried many more things for 8+ hrs.. I don't recall all of them but here are some different error messages I got:
Error occurred during initialization of boot layer
java.lang.module.FindException: Error reading module: . . .
module-info 2.class found in top-level directory
I think the last error has to do with creating second .class files in bin folder.. I don't know what's causing it but I had to delete all duplicate .class files manually many times. (If somebody can tell me why this is happening, it will be greatly appreciated...)
I've never used Gradle nor JavaFX in my life so this might be a dumb question but please help me out.
FYI, the repo I cloned is
https://github.com/mfl28/BoundingBoxEditor.git

java.lang.NoClassDefFoundError: Fast way to add lots of classpath variables at once

I'm getting tons of errors when I try to run a baby SWT/JFace application. EEach error disappears - and is replaced by a new one - as soon as I go into the BuildPath and add a Variable to satisfy what the Error log is looking for. However, this is proving to take a lot of time, and I am wondering if I am doing this right? Is there a better way?
It doesn't make sense to me that I'd have to manually be telling Eclipse where to find all jar's it needs (like org.eclipse.ui and org.eclipse.jface). They are all right there in the plugins folder!
Here's a screenshot to give you an idea of what the errors look like:
Try to configure your build path from Project->properties->Java Build Path -> Libraries , remove all your jars and again include the Jars in your build path . Project->Clean .. your project . This may solve your issue
Try downloading the SWT jar from here
And if still you are getting those ClassNotFound errors you need to put all the jars it asks for in your classpath.

Referencing a GWT project from another GWT one - Problems

I am already using an open source GWT project (iServe) and I would like to integrate into it another open source GWT project (PetalsBPM), by which I mean being able to call it and reference its methods.
I have imported iServe in Eclipse (it has multiple modules) as separate Maven projects referencing its other and can run it successfully through Runas -> Web application in development mode.
If I do that and run the other project through the console as mvn gwt:run, I call initiate PetalsMBP through iServe. However, that means that the two programs have to run as is, without communication with each other.
I have also imported the second project into eclipse as a java project successfully (converting into a Maven one causes problems - various lifecycle configurations ones), but whenever I try to add to to iServe through Properties -> Java Build Path -> Projects, although it does not cause any errors immediately, I cannot launch iServe anymore. It produces the following error:
"Exception occurred executing command line.
Cannot run program "C:\Program Files\Java\jre7\bin\javaw.exe" (in directory "C:...iserve-sal-gwt-1.0.0-SNAPSHOT"): CreateProcess error=206, The filename or extension is too long"
Are my problems related to the fact that PetalsBPM is not a Maven project in Eclipse (I doubt it)?
Am I doing something wrong, i.e., this is not the way to reference a project from another one? should I add a reference to the first project's (iServe) gwt.xml file?
Is there a way to do what I want without having to wrap the second project as a jar and calling it from iServe? I would prefer not to, since producing a jar every time I make a slight change is not exactly efficient!
P.S: The second project is a regular GWT project with an entrypoint, not just a module. Should I remove this?
UPDATE: Trying to figure out the source of this error, I attempted to simplify the problem, so I performed the following moves:
I created two new simple GWT projects and tried to reference one
from the other. Worked fine
I referenced the project I actually want
to use (PetalsBPM) from the simple one I just created. Also works
fine.
I referenced the new simple project from the original one I
want to use (iServe). Also works fine.
Tried doing what I actually
want to do, copying the settings from 2&3. Produces the same error
"CreateProcess error=206, The filename or extension is too long" if
I reference PetalsBPM (does not when I remove it from the referenced
projects)
So, I tried switching workspaces. I created a new workspace in C:\, and moved the actual projects there. Still it did not work. :(
Any more ideas?
I met the same type of error "Create Process, error=206, path too long etc." a hundred times.
Then, I found a solution/explanation in google-groups, it solved my problem.
I post the content and link as it might help others.
This website (StackOverflow) really helped me a thousand times.
Thanks to you all !
solution/explanation :
(Response from Stephen Johnson)
(...) if you're using eclipse plugin go to Project | Properties, choose
Google \ App Engine \ ORM and only include directories that you have
classes that you want enhanced. By default it does the entire project
so that includes a lot of needless files. (...)
Link :
original post # google-groups
Read the exception message again. Somewhere along the way Maven is generating a path that is too long for (some) Windows API to handle, try moving your workspace to a directory straight below C:\.
I just tried "skolima" reply and it worked for me. In Eclipse I clicked File->Switch Workspace.
Three things to note:
After I created the workspace in "C:\workspace" I had to update my Project->Properties > Java Build Path > Libraries > Add External JARs...
I'm using Windows 7.
I'm using "Eclipse Java EE IDE for Web Developers"
I hope this others.

Location of config file for devmode in Eclipse?

I have a multi module GWT project (say a.gwt.xml, b.gwt.xml, c.gwt.xml) that I am building in eclipse and testing in devmode. All was working well until I deleted one of the gwt module file and associated source. Now when I try to launch devmode from eclipse it fails with the following error message.
Loading modules
com.fubar.b
[ERROR] Unable to find 'com/fubar/b.gwt.xml' on your classpath; could be a typo, or maybe you forgot to include a classpath entry for source?
[ERROR] shell failed in doStartup method
I assume that this means there is a stale reference to the now defunct b.gwt.xml but I can't seem to find it in any of the config files. Any ideas?
At present I am working around this by doing a copy+rename a.gwt.xml -> b.gwt.xml (so there are effectively 2 copies of the a module names a + b) which works fine but compiles 2 copies of same module :(
What I think is your runtime configuration which is gone wrong. Individual projects should be fine. Open the runtime configuration which you were running and check the entries in GWT! If the module you have deleted still exists here, then you need to remove it.
Runtime config for project
You can refer to the following Video.
http://www.youtube.com/watch?v=UW4WSYs1bKE
To rename
Right Click on the project.
Select Run As ---> Run Configurations.
In the Arguments Tab, change the Old Module Names in Program
Arguments.
Also Make sure, in GWT Tab, Selected module name is correct.
ALREADY I HAVE ANSWERED THIS HERE : GWT:how can i rename my module

How to add a library into Processing from Eclipse platform?

I installed the Processing plugin for Eclipse. it works fine. But then i copied the folder gifAnimation into C:\Program Files\eclipse\plugins\processing.plugin.core_0.2.5.1\Resources\libraries. All the other libraries are there.
but "import gifAmination.*;" does not work.
and gives the following error.
Library import "gifAnimation" could not be found. Check the library folder in your sketchbook.
It's been awhile since I used Processing in Eclipse, but I think you need to add libraries explicitly to the build path. There is a tutorial here which will walk you through the whole process of getting Eclipse working with Processing, including adding extra libraries. The main thing you need to do is browse to your added libraries, and use Eclipse's 'Add to Build Path" menu option.