I have created Excel Sheet using Java program. It works fine.
My problem is, I have copied the .class file into other directory with the necessary jar files need to create this excel sheet, for example
My .class is inside "pack" package.
c:/myprogram/pack/excelprogram.class to d:/myprogram
/pack/excelprogram.class
/jxl.jar
/ojdbc14.jar
If I run the program
javac pack.excelprogram
it display below error
Caused by: java.lang.ClassNotFoundException: jxl.format.CellFormat
I have dependency jar file (jxl.jar) for this Excel sheet creation. Error is displaying from that only.
I have set class path for this jar file like
set classpath="%classpath%";d:/myprogram/jxl.jar;d:/myprogram/ojdbc14.jar;.;
even though I’m getting the same error.
First: You have a class-file (excelprogram.class) if I understand you right. If you want to execute this, you should use java, not javac (that is the compiler to produce the .class-files).
To the question itself: you can specify the classpath on the java-commandline. Try: