pavelfomin / gphoto-manager

Google Photos Manager
3 stars 0 forks source link

Class not found org.codehaus.groovy.vmplugin.v7.Java7 #10

Closed aoberoi closed 3 months ago

aoberoi commented 4 months ago

I'm attempting to run the application for the first time, so I'm running it with no options, to see the usage info.

$ java -jar gphoto-manager-0.1.5.jar

The output is a long stacktrace that begins with this error:

java.lang.NoClassDefFoundError: Could not initialize class org.codehaus.groovy.vmplugin.v7.Java7
    at org.codehaus.groovy.vmplugin.VMPluginFactory.<clinit>(VMPluginFactory.java:43)
    at org.codehaus.groovy.reflection.GroovyClassValueFactory.<clinit>(GroovyClassValueFactory.java:35)
    at org.codehaus.groovy.reflection.ClassInfo.<clinit>(ClassInfo.java:107)
    at org.codehaus.groovy.reflection.ReflectionCache.getCachedClass(ReflectionCache.java:95)

I can provide the rest of the stacktrace if that is helpful.

I should note that I'm running this on macOS, using the latest version of OpenJDK. I only really installed the OpenJDK to use this application. But as far as I'm aware, its a functional Java installation. Side note: You may want to include some requirements info for Java, such as which versions are compatible, in the README.

$ java -version
openjdk version "22.0.1" 2024-04-16
OpenJDK Runtime Environment Homebrew (build 22.0.1)
OpenJDK 64-Bit Server VM Homebrew (build 22.0.1, mixed mode, sharing)
pavelfomin commented 4 months ago

yeah, this app was created using JDK 11 and Groovy 2.5. I need to port this app to the latest java and groovy. If you can use JDK 11 it would work but it may not be available anymore.

pavelfomin commented 4 months ago
pavelfomin commented 3 months ago

Use latest release https://github.com/pavelfomin/gphoto-manager/releases/tag/v1.2.0. It works with Java runtime 17+.

$ java -version
java version "22.0.2" 2024-07-16
Java(TM) SE Runtime Environment (build 22.0.2+9-70)
Java HotSpot(TM) 64-Bit Server VM (build 22.0.2+9-70, mixed mode, sharing)
$ java -jar ~/Downloads/temp/gphoto-manager-1.2.0.jar
Usage: java -Dtoken=<access token> [-Dsuppress-warnings] [-Dignore-media-items-file=<file with media items to ignore>] -jar gphoto-manager-<version>.jar [options]
            --albums           list all albums, sorted by name
            --album-items      list all items per album (use with care for large number of media items)
            --items            list all items (use with care for large number of media items)
            --items-no-album   list all items not included in any album
            -Dtoken=<access token> OAuth 2 Access Token
                                    can be obtained from https://developers.google.com/oauthplayground
                                    use 'https://www.googleapis.com/auth/photoslibrary.readonly' as the requested scope
            -Dsuppress-warnings suppress all warnings, including album media count / items mismatch
            -Dignore-media-items-file=<file with media items to ignore> file with media item urls to ignore