Results 1 to 2 of 2
  1. #1
    AlakaAlaki is offline Member
    Join Date
    Jun 2008
    Rep Power

    Default Issue with JNI and C library

    Hi, I hope this is in the right forum since I am a beginner heh.

    I'm working in fedora code 5.
    I'm a math student trying to put together what should be not too complicated a program.
    I've written some code in java using JNI to call a method from a C library to make a call to another program (written in C).
    However, I'm getting an error that I can't figure out.
    I run my program from the terminal and get the following:
    Java Code:
    $java RunApplication
    Exception in thread "main" java.lang.NoClassDefFoundError: loaded class RunApplication was in fact named sequence.RunApplication
       at java.lang.VMClassLoader.defineClass(
       at java.lang.ClassLoader.defineClass(
       at java.lang.ClassLoader.loadClass(
       at java.lang.ClassLoader.loadClass(
       at java.lang.Class.forName(
    All of my java class files are in the same folder, along with the Clibraries and I have set the library path to said folder.
    I'd read that this error can come from a problem with the classpath, however it should check the folder the executed class is in(or so I have read). So unless I somehow messed that up I don't think it is the issue.

    In case it helps, here is the code of the class I am executing.

    Java Code:
    package sequence;
    public class RunApplication {
    	private native static int getAutomorphismGroup(int fw, int[] arr);
    	public static void main(String args[]) {
    		int[] p = {1, 5,12};
    		OfszObject ofz = new OfszObject(p);
    		int fw = ofz.getfw();
    		int[][] adj = ofz.getadjacencylist();
    		int[] arr = new int[fw*fw];
    		int c = 0;
    		for (int i=0; i<fw; i++){
    			for (int j=0; j<fw; j++){
    				System.out.print(adj[i][j]+" ");
    				arr[c] = adj[i][j];
    		getAutomorphismGroup(fw, arr);
    	static {
    Thank you very much for any and all help.
    I hope I've followed all the rules :).

  2. #2
    Nicholas Jordan's Avatar
    Nicholas Jordan is offline Senior Member
    Join Date
    Jun 2008
    Rep Power


    I have grown frustrated with this error, on win it seems to reduce if one does all the work in My Documents or otherwise as traditionally considered to be home dir. Not the way I would do it but the os wants to prepend home dir info.

    Directed Acyclic or simple edge list?

Similar Threads

  1. Compile Issue
    By CrazyShells Slam in forum New To Java
    Replies: 4
    Last Post: 05-14-2008, 09:51 PM
  2. JFormattedTextField Issue
    By teracomp in forum AWT / Swing
    Replies: 1
    Last Post: 01-21-2008, 07:55 PM
  3. Try Catch issue
    By curtis_fraser in forum Advanced Java
    Replies: 2
    Last Post: 12-14-2007, 12:04 AM
  4. Issue
    By chaitu444 in forum New To Java
    Replies: 2
    Last Post: 11-06-2007, 08:49 PM
  5. compilation issue
    By orchid in forum Eclipse
    Replies: 2
    Last Post: 04-20-2007, 01:51 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts