Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting error on mac when starting the program #6

Open
jitendravyas opened this issue Apr 24, 2019 · 11 comments
Open

Getting error on mac when starting the program #6

jitendravyas opened this issue Apr 24, 2019 · 11 comments
Labels
bug Something isn't working

Comments

@jitendravyas
Copy link

image

@addshore
Copy link
Owner

addshore commented Jul 9, 2019

Sorry for a slow reply here, apparently I havn't been stalking this repo.

I have no idea what is causing that issue, what OS version are you running?
I don't have a mac myself to try this out on, but I know it has worked for some other people.

@addshore addshore added the bug Something isn't working label Aug 9, 2019
@mpatfield
Copy link

Excited to try this out but am unfortunately experiencing the same problem. I'm on macOS Catalina 10.15.1 and I tried looking in the system console as the error message suggests, but didn't see anything obvious.

Happy to help debug if there's anything you want me to try.

@addshore
Copy link
Owner

addshore commented Jan 3, 2020

I have no idea how to debug this on a mac, all I can hope is that someone manages to find a more verbose / system level / java log message somewhere that gives us a hint!

@mpatfield
Copy link

There is a bit more info if you run the jar directly from the terminal:

mpatfield$ java -jar facebook-data-image-exif.jar 
Error: Could not find or load main class com.github.addshore.facebook.data.image.exif.Main
Caused by: java.lang.NoClassDefFoundError: javafx/application/Application

@addshore addshore changed the title Getting error on mac Getting error on mac when starting the program Apr 5, 2020
@ChimeraCoder
Copy link

It's not just on a Mac: I get the same error when running under Ubuntu 20.04 (Focal):

Error: Could not find or load main class com.github.addshore.facebook.data.image.exif.Main
Caused by: java.lang.NoClassDefFoundError: javafx/application/Application
Error: Could not find or load main class com.github.addshore.facebook.data.image.exif.Main
Caused by: java.lang.NoClassDefFoundError: javafx/application/Application

@pbcornelius
Copy link

pbcornelius commented Jan 23, 2021

It was build with Java 8 and needs Java 8 to run. Since Java 9, com.sun.javafx.css.converters.PaintConverter doesn't exist anymore (or rather, doesn't exist in this location anymore).

@addshore
Copy link
Owner

As of a few days ago this is now built with JDK 11
550761f
which sounds like perhaps this would be fixed with a new build? https://stackoverflow.com/questions/46754639/javafx-weird-classnotfoundexception-after-updating-to-java-9#46756098

You can give this a go at https://github.com/addshore/facebook-data-image-exif/releases/tag/0.11-alpha1

@pbcornelius
Copy link

pbcornelius commented Jan 24, 2021

Thanks for the quick response. I made it work yesterday with Java 8 and have processed all my Facebook pictures.

Since JDK11, JavaFX is not part of the default JRE anymore. It needs to be downloaded separately and the run command needs to include something like --module-path {PATH_TO_FX} --add-modules=javafx.controls. {PATH_TO_FX} will be different on different machines.

JavaFX supports building self-contained runnables that include all libraries. Might be worth setting up once and then it'll run for years. I think there is also the option to pack all required classes in the JAR when you build it.

Great tool btw, thanks a lot for creating it!

@addshore
Copy link
Owner

on master now javafx is fetched from maven and bundled with the build jar.
So, fingers crossed that jar linked above should work out of the box for you and other people in this situation!

@merttoka
Copy link

merttoka commented May 7, 2021

A similar issue happens on Windows 10 as well with JDK-11.0.10.9. I tried both 0.1 and 0.11 versions.

java.exe --module-path .\facebook-data-image-exif\javafx-sdk-11.0.2\lib --add-modules javafx.controls -jar .\facebook-data-image-exif.jar
Exception in Application start method
java.lang.reflect.InvocationTargetException
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:566)
        at javafx.graphics/com.sun.javafx.application.LauncherImpl.launchApplicationWithArgs(LauncherImpl.java:464)
        at javafx.graphics/com.sun.javafx.application.LauncherImpl.launchApplication(LauncherImpl.java:363)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:566)
        at java.base/sun.launcher.LauncherHelper$FXHelper.main(LauncherHelper.java:1051)
Caused by: java.lang.RuntimeException: Exception in Application start method
        at javafx.graphics/com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:900)
        at javafx.graphics/com.sun.javafx.application.LauncherImpl.lambda$launchApplication$2(LauncherImpl.java:195)
        at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: java.lang.IllegalAccessError: class com.sun.javafx.fxml.FXMLLoaderHelper (in unnamed module @0x5925857d) cannot access class com.sun.javafx.util.Utils (in module javafx.graphics) because module javafx.graphics does not export com.sun.javafx.util to unnamed module @0x5925857d
        at com.sun.javafx.fxml.FXMLLoaderHelper.<clinit>(FXMLLoaderHelper.java:38)
        at javafx.fxml.FXMLLoader.<clinit>(FXMLLoader.java:2056)
        at com.github.addshore.facebook.data.image.exif.MainView.<init>(MainView.java:39)
        at com.github.addshore.facebook.data.image.exif.Main.getDataEntryScene(Main.java:94)
        at com.github.addshore.facebook.data.image.exif.Main.start(Main.java:44)
        at javafx.graphics/com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$9(LauncherImpl.java:846)
        at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runAndWait$12(PlatformImpl.java:455)
        at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$10(PlatformImpl.java:428)
        at java.base/java.security.AccessController.doPrivileged(Native Method)
        at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$11(PlatformImpl.java:427)
        at javafx.graphics/com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:96)
        at javafx.graphics/com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
        at javafx.graphics/com.sun.glass.ui.win.WinApplication.lambda$runLoop$3(WinApplication.java:174)
        ... 1 more
Exception running application com.github.addshore.facebook.data.image.exif.Main

and if I execute with javafx.controls,javafx.fxml modules, I get the error mentioned above:

java.exe --module-path .\facebook-data-image-exif\javafx-sdk-11.0.2\lib --add-modules javafx.controls,javafx.fxml -jar .\facebook-data-image-exif.jar
Exception in Application start method
java.lang.reflect.InvocationTargetException
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:566)
        at javafx.graphics/com.sun.javafx.application.LauncherImpl.launchApplicationWithArgs(LauncherImpl.java:464)
        at javafx.graphics/com.sun.javafx.application.LauncherImpl.launchApplication(LauncherImpl.java:363)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:566)
        at java.base/sun.launcher.LauncherHelper$FXHelper.main(LauncherHelper.java:1051)
Caused by: java.lang.RuntimeException: Exception in Application start method
        at javafx.graphics/com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:900)
        at javafx.graphics/com.sun.javafx.application.LauncherImpl.lambda$launchApplication$2(LauncherImpl.java:195)
        at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: java.lang.NoClassDefFoundError: com/sun/javafx/css/converters/PaintConverter
        at com.jfoenix.controls.JFXTextField$StyleableProperties.<clinit>(JFXTextField.java:241)
        at com.jfoenix.controls.JFXTextField.<init>(JFXTextField.java:146)
        at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
        at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
        at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)
        at java.base/java.lang.Class.newInstance(Class.java:584)
        at javafx.fxml/javafx.fxml.FXMLLoader$InstanceDeclarationElement.constructValue(FXMLLoader.java:1019)
        at javafx.fxml/javafx.fxml.FXMLLoader$ValueElement.processStartElement(FXMLLoader.java:754)
        at javafx.fxml/javafx.fxml.FXMLLoader.processStartElement(FXMLLoader.java:2722)
        at javafx.fxml/javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2552)
        at javafx.fxml/javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2466)
        at javafx.fxml/javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:3237)
        at javafx.fxml/javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:3194)
        at javafx.fxml/javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:3163)
        at javafx.fxml/javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:3136)
        at javafx.fxml/javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:3113)
        at javafx.fxml/javafx.fxml.FXMLLoader.load(FXMLLoader.java:3106)
        at com.github.addshore.facebook.data.image.exif.MainView.<init>(MainView.java:39)
        at com.github.addshore.facebook.data.image.exif.Main.getDataEntryScene(Main.java:94)
        at com.github.addshore.facebook.data.image.exif.Main.start(Main.java:44)
        at javafx.graphics/com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$9(LauncherImpl.java:846)
        at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runAndWait$12(PlatformImpl.java:455)
        at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$10(PlatformImpl.java:428)
        at java.base/java.security.AccessController.doPrivileged(Native Method)
        at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$11(PlatformImpl.java:427)
        at javafx.graphics/com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:96)
        at javafx.graphics/com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
        at javafx.graphics/com.sun.glass.ui.win.WinApplication.lambda$runLoop$3(WinApplication.java:174)
        ... 1 more
Caused by: java.lang.ClassNotFoundException: com.sun.javafx.css.converters.PaintConverter
        at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:581)
        at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
        at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
        ... 30 more
Exception running application com.github.addshore.facebook.data.image.exif.Main

@TechRemarker
Copy link

TechRemarker commented Aug 21, 2022

On Apple Silicon Mac, ran and it opened but anytime clicked Browse for either of the browser buttons in the GUI it would just spin endlessly and freeze. I then read that it needs Java 11 instead of the the Java 8 that is on the latest Macs. I'm on Ventura Beta. I installed Java 11 here https://www.oracle.com/java/technologies/javase/jdk11-archive-downloads.html Arm 64 DMG Installer and all appears to have gone smoothly. I get the java file could not launch to checked console error, or sometimes nothing happens when clicking it. But has not been able to run since updating from Java 8 to 11 on Mac. Any thoughts? Or does all this JavaFX additional commands noted in this thread still required even on a Mac and using the latest addshore code?

Update: While java -version shows 11 is installed, I do see in Mac Preferences > Java it shows 8 there. But seems everywhere else is showing 11, so probably not that?
Update 2: Since see no relevant errors in Console.app, tried running the jar from the command line with java -jar /Users/chris/Desktop/facebook-data-image-exif.jar and low and behold got the error, "Error: JavaFX runtime components are missing, and are required to run this application". So seems like as others noted related to JavaFX. Will try to see what version of JavaFX is need to go along with 11, and that will work on macOS Apple Silicon.

Tried:

export PATH_TO_FX=/Users/chris/java/javafx-sdk-18.0.2/lib
java --module-path $PATH_TO_FX --add-modules=javafx.controls /Users/chris/Documents/Downloads/facebook-data-image-exif.jar 

Says: ```
Error: Could not find or load main class .Users.chris.Documents.Downloads.facebook-data-image-exif.jar
Caused by: java.lang.ClassNotFoundException: /Users/chris/Documents/Downloads/facebook-data-image-exif/jar

Since others are running into the same issue since January and no resolution here yet, I'll presume it's not working for anyone using Java 11 yet, and will see if I can install java 8 and try running that if that have that for Apple silicon that is.

Finally got it. Gave up on Java 11. Uninstalled that using `/usr/libexec/java_home -V` and doing `sudo rm -rf /Library/Java/JavaVirtualMachines/jdk-11.0.16.jdk/Contents/Home`. Then ran `java -jar /Users/chris/Documents/Downloads/facebook-data-image-exif.jar` Using the latest version from GitHub. Didn't click the browse buttons and instead typed in manually. For the first field make sure posts is at the end such as `/Users/chris/posts` and the location it recommended for exif was correct otherwise type in `which exiftool`.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

7 participants