I have 2 classes:
class1.java uses helper/TradeHelper.java 's connect method.
helper is the package.
class1.java uses this method in its main method.
helper/TradeHelper.java 's connect method, which is static.
Public static Connection connect(String db){
Connection conn = null;
Properties props =loadProperties();
String user = props.getProperty("user");
String password = props.getProperty("password");
String url = props.getProperty(db);
String driver = props.getProperty("driver");
try{
Class.forName(driver);
conn = DriverManager.getConnection(url, user, password);
}catch(Exception e){
e.printStackTrace();
}
return conn;
}
Notice in the above code, TradeHelper.java is using other static methods (loadProperties to load a props file) inside of itself.
Not sure why but I keep getting:
java.lang.NoClassDefFoundError: helper/TradeHelper
Ive tried jdk 1.6.0_18 and 1.6.0_20 with no success.
Any ideas?