Hello guys,
I am having a problem testing an small Java code to be used with
Berkeley DB Java Edition. I have created a Java Project, then I've
created a package and inside of this package I've created a class
with the following code:
package com.x2iq.iqSearchDB;
import com.sleepycat.je.DatabaseException;
import com.sleepycat.je.Environment;
import com.sleepycat.je.EnvironmentConfig;
import java.io.File;
public class SentencesDB {
private Environment myDbEnvironment;
private String db_Base;
private String sentence;
private String root;
private int times;
private int total_level;
private int min_level;
private int max_level;
private int last_level;
private int bottom_node;
public SentencesDB() {
myDbEnvironment = null;
db_Base = "/usr/local/";
}
public void openDB() {
try {
EnvironmentConfig envConfig = new EnvironmentConfig();
envConfig.setAllowCreate(true);
myDbEnvironment = new Environment(new File("/usr/local/
iq_data"), envConfig);
} catch (DatabaseException dbe) {
// Exception handling goes here
}
}
public void closeDB() {
try {
if (myDbEnvironment != null) {
myDbEnvironment.close();
}
} catch (DatabaseException dbe) {
// Exception handling goes here
}
}
}
Then I try to test it in the scrapbook with the following code:
SentencesDB db = new SentencesDB();
db
And I get this error:
java.lang.NoClassDefFoundError: com/sleepycat/je/DatabaseException