ErrorxCode / JxInsta

An object-oriented reverse engineered instagram web API made in Java. Now build bots, scrap data, create instagram apps, and a lot more in your favourite language
Apache License 2.0
21 stars 5 forks source link

error: cannot access PublicAPIs #10

Closed animexxx closed 2 weeks ago

animexxx commented 7 months ago

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

ErrorxCode commented 7 months ago

Java version 17 or greater is required

animexxx commented 7 months ago

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 `

com.errorxcode.jxinsta
        <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>`
ErrorxCode commented 7 months ago

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

animexxx commented 7 months ago

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

Any in the libs throw error

ErrorxCode commented 7 months ago

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>

animexxx commented 7 months ago

already copy to lib and libs folder to project path friend

ErrorxCode commented 7 months ago

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