源FIE一個程序 - > 位置C:/程序文件/ JAVA/jdk1.6.0_07/bin中我米不能執行使用JXL
import java.io.File;
import java.io.IOException;
import jxl.*;
public class Geeta {
private String inputFile;
public void setInputFile(String inputFile) {
this.inputFile = inputFile;
}
public void read() throws Exception {
File inputWorkbook = new File(inputFile);
Workbook w;
w = Workbook.getWorkbook(inputWorkbook);
// Get the first sheet
Sheet sheet = w.getSheet(0);
// Loop over first 10 column and lines
Cell a1 = sheet.getCell(0,0);
String stringa1 = a1.getContents();
System.out.println(stringa1);
}
public static void main(String[] args) throws Exception {
Geeta test = new Geeta();
test.setInputFile("c:/Progra~1/Java/jdk1.6.0_07/bin/jxlrwtest.xls");
test.read();
}
}
編譯爲 javac的-classpath jxl.jar集塔。 java的
當我嘗試執行它說..的NoClassDefFoundError
Java的罐子jxl.jar吉塔
C:\ Program Files文件\的Java \ jdk1.6.0_07 \ BIN>的Java -ja r jxl.jar Geeta 線程「main」中的異常java.lang.NoClassDefFoundError:Geeta 由java.net.URLlassLoader導致.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:188) at java.lang.ClassLoader.loadClass(ClassLoader.java:306) at sun.misc.Launcher $ AppClassLoader.loadClass(Launcher.java:276) 在java.lang.ClassLoader.loadClass(ClassLoader.java:251) 在java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
PLZ。意見...
plz format teh codes! – miku 2011-01-08 15:36:21