JxInsta icon indicating copy to clipboard operation
JxInsta copied to clipboard

error: cannot access PublicAPIs

Open animexxx opened this issue 1 year ago • 7 comments

I tried to add libs like this:

<dependency>
            <groupId>com.errorxcode.jxinsta</groupId>
            <artifactId>jxinsta</artifactId>
            <version>v1.0-beta-2</version>
            <scope>system</scope>
            <systemPath>${project.basedir}/JxInsta-v1.0-beta-2.jar</systemPath>
</dependency>

im using netbeans and java 1.8, but it always return error cannot access PublicAPIs when run the project. Look like it not work with local dependency , please help

updated: when i try with Ant and add the Jar file Exception in thread "main" java.lang.UnsupportedClassVersionError: com/errorxcode/jxinsta/endpoints/PublicAPIs has been compiled by a more recent version of the Java Runtime (class file version 61.0), this version of the Java Runtime only recognizes class file versions up to 52.0

animexxx avatar Apr 21 '24 11:04 animexxx

Java version 17 or greater is required

ErrorxCode avatar Apr 21 '24 18:04 ErrorxCode

I install java 22. Then it still error `Exception in thread "main" java.lang.NoClassDefFoundError: com/errorxcode/jxinsta/endpoints/PublicAPIs


package dd.main;

import com.errorxcode.jxinsta.endpoints.PublicAPIs;
import com.errorxcode.jxinsta.endpoints.profile.Profile;
import kong.unirest.Unirest;

/**
 *
 * @author Joey
 */
public class Main {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        Unirest.config().verifySsl(false).followRedirects(true);
        Profile profile;
        try {
            profile = PublicAPIs.getProfileInfo("x0.rahil");

            profile.posts.forEach(item -> {
                System.out.println(item.download_url);
            });
        } catch (Exception ex) {
            ex.printStackTrace();
        }

    }

}

pom.xml <dependency> <groupId>com.errorxcode.jxinsta</groupId> <artifactId>jxinsta</artifactId> <version>v1.0-beta-2</version> <scope>system</scope> <systemPath>D:/Work/java/igScanV3/JxInsta-v1.0-beta-2.jar</systemPath> </dependency>

animexxx avatar Apr 22 '24 04:04 animexxx

are other classes working? Like the main JxInsta class, or does every class of the library is throwing the same error?

ErrorxCode avatar Apr 22 '24 16:04 ErrorxCode

Exception in thread "main" java.lang.NoClassDefFoundError: com/errorxcode/jxinsta/JxInsta

Any in the libs throw error

animexxx avatar Apr 23 '24 16:04 animexxx

That means your library is not properly included in your project. Put your jar file in libs folder of your java project and then set that path like this, <systemPath>${project.basedir}/lib/JxInsta-v1.0-beta-2.jar</systemPath>

ErrorxCode avatar Apr 23 '24 17:04 ErrorxCode

already copy to lib and libs folder to project path friend

animexxx avatar Apr 24 '24 07:04 animexxx

I tried to add libs like this:

<dependency>
            <groupId>com.errorxcode.jxinsta</groupId>
            <artifactId>jxinsta</artifactId>
            <version>v1.0-beta-2</version>
            <scope>system</scope>
            <systemPath>${project.basedir}/JxInsta-v1.0-beta-2.jar</systemPath>
</dependency>

im using netbeans and java 1.8, but it always return error cannot access PublicAPIs when run the project. Look like it not work with local dependency , please help

updated: when i try with Ant and add the Jar file Exception in thread "main" java.lang.UnsupportedClassVersionError: com/errorxcode/jxinsta/endpoints/PublicAPIs has been compiled by a more recent version of the Java Runtime (class file version 61.0), this version of the Java Runtime only recognizes class file versions up to 52.0

Just the way you did this, do it again with the latest Java (or 16+) version and you will not get UnsupportedClassVersionError

ErrorxCode avatar Apr 24 '24 16:04 ErrorxCode