Reputation: 43
running a java class by shell script:
java -cp $CLASSPATH CG_GpsRequest "dbname","oracle.jdbc.driver.OracleDriver","abc","abc"
while running the script in unix, getting error,
Exception in thread "main" java.lang.NoClassDefFoundError: CG_GpsRequest
Caused by: java.lang.ClassNotFoundException:
CG_GpsRequest
is the class file name.
Upvotes: 0
Views: 94
Reputation: 1219
Okay.. If I understand you correctly..
I think its problem with the Package name specification..
Your calss CG_GpsRequest
you must have specified in Packaging way for example
com.xxx.yyy.CG_GpsRequest
So I think JVM
is searching your class com.xxx.yyy.CG_GpsRequest
in this patter so Please run your script with the following modifications.
java -cp $CLASSPATH com.xxx.yyy.CG_GpsRequest "dbname","oracle.jdbc.driver.OracleDriver","abc","abc"
This is just assumption that you have created your class in Pacakgin hirarechy since you havent specified more information.
Upvotes: 1