Closed animexxx closed 2 weeks ago
Java version 17 or greater is required
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
`
<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>`
are other classes working? Like the main JxInsta
class, or does every class of the library is throwing the same error?
Exception in thread "main" java.lang.NoClassDefFoundError: com/errorxcode/jxinsta/JxInsta
Any in the libs throw error
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>
already copy to lib and libs folder to project path friend
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
I tried to add libs like this:
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