NoClassDefFoundError T.T

C

chriskr7

HI, There.

I am having problem with executing java class file. Every path setting
are in right

position. When I compile like a simple hello program it works right and
it executes.

However, when I compile below source file, It compiles.. but when I try
to

execute it, there is an error coming out like this

"Exception in thread "main" java.lang.NoClassDefFoundError: INativeQR
<wrong

name: kr/co/sunwooinfo/INativeQR".

My OS is XP sp2 and sdk is jdk1.5.0_07. and the dll file is compiled
with g++

and the native function in c++ is
Java_kr_co_sunwooinfo_INativeQR_MakeQR().

I tested everything in windows enviroment including the dll file, and
It works right.

but having trouble with jdk. is there any expert who can give me some
advices?


===============================================================

/**
------------------------------------------------------------------------
**\
** File Name:
**
** INativeQR.java
**
** Distribute:
**
** Define INativeQR Class for Calling Navive Function(MakeQR)
**
\**
------------------------------------------------------------------------
**/


package kr.co.sunwooinfo;

import java.lang.*;
import java.io.*;
import java.util.*;

public class INativeQR
{
//
--------------------------------------------------------------------------
// --------- Native Function
----------
//
--------------------------------------------------------------------------
public native int MakeQR(byte[] pSavePath, byte[] pFileName, byte[]
pSource,
int pDevide, int pErrorDegree, int
pEncodeOpt, int pStretch);

static {
System.loadLibrary("INativeQR");
}

//
--------------------------------------------------------------------------
// --------- Member Values
----------
//
--------------------------------------------------------------------------

private static final String SEPARATOR = "/";

private String g_sSavePath;
private String g_sFileName;
private String g_sSourceData;
private int g_iDivideNumber;
private int g_iErrorDegree;
private int g_iEncOpt;

private int g_iStretch;

private boolean g_bResult;
private Vector g_vResultMessage;



//
--------------------------------------------------------------------------
// --------- Member Functions
----------
//
--------------------------------------------------------------------------

/**
----------------------------------------------------------------------
**\
** @ Function Name
**
** : INativeQR
**
**
**
** @ Distribute
**
** : Constructor
**
** Init Member Value
**
\**
----------------------------------------------------------------------
**/
public INativeQR()
{
g_sSavePath = "c:\\work";
g_sFileName = "test";
g_sSourceData = "chris han is testing now...";
g_iDivideNumber = 1;
g_iErrorDegree = 2;
g_iEncOpt = 0;
g_iStretch = 1;
g_bResult = true;
}

public boolean makeQR()
{
int iResult = 0;

/*for-windows*/
byte[] aSavePath = g_sSavePath.getBytes();
byte[] aFileName = g_sFileName.getBytes();
byte[] aSource = g_sSourceData.getBytes();

System.out.println("MakeQR calling...");
iResult = MakeQR(aSavePath, aFileName, aSource, g_iDivideNumber,
g_iErrorDegree, g_iEncOpt, g_iStretch);

if(iResult != 0)
g_bResult = true;
else
g_bResult = false;

return g_bResult;
}


public static void main(String args[]){
INativeQR QRBuilder = new INativeQR();
QRBuilder.makeQR();
if(QRBuilder.g_bResult)
System.out.println("Success");
else
System.out.println("Fail");
}
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,226
Members
46,815
Latest member
treekmostly22

Latest Threads

Top