Ich will ein Java Programm schreiben, welches eine Excel Datei erstellen soll und benutze dafür die apache.poi library. Meine Code sieht wie folgt aus:[/I
import java.io.FileOutputStream;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
public class Excel {
public static void main(String[] args) {
HSSFWorkbook datei = new HSSFWorkbook();
try {
FileOutputStream output = new FileOutputStream("Excel.xls");
datei.write(output);
output.close();
}
catch (Exception e) {
}
}
}]
Ich bekomme allerdings folgende Fehlermeldung:
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/math3/util/ArithmeticUtils
at org.apache.poi.poifs.property.RootProperty.setSize(RootProperty.java:59)
at org.apache.poi.poifs.property.DirectoryProperty.<init>(DirectoryProperty.java:52)
at org.apache.poi.poifs.property.RootProperty.<init>(RootProperty.java:31)
at org.apache.poi.poifs.property.PropertyTable.<init>(PropertyTable.java:58)
at org.apache.poi.poifs.filesystem.POIFSFileSystem.<init>(POIFSFileSystem.java:99)
at org.apache.poi.poifs.filesystem.POIFSFileSystem.<init>(POIFSFileSystem.java:121)
at org.apache.poi.hssf.usermodel.HSSFWorkbook.write(HSSFWorkbook.java:1357)
at Excel.main(Excel.java:12)
Caused by: java.lang.ClassNotFoundException: org.apache.commons.math3.util.ArithmeticUtils
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:636)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:182)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:519)
... 8 more
Was mache ich falsch?
import java.io.FileOutputStream;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
public class Excel {
public static void main(String[] args) {
HSSFWorkbook datei = new HSSFWorkbook();
try {
FileOutputStream output = new FileOutputStream("Excel.xls");
datei.write(output);
output.close();
}
catch (Exception e) {
}
}
}]
Ich bekomme allerdings folgende Fehlermeldung:
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/math3/util/ArithmeticUtils
at org.apache.poi.poifs.property.RootProperty.setSize(RootProperty.java:59)
at org.apache.poi.poifs.property.DirectoryProperty.<init>(DirectoryProperty.java:52)
at org.apache.poi.poifs.property.RootProperty.<init>(RootProperty.java:31)
at org.apache.poi.poifs.property.PropertyTable.<init>(PropertyTable.java:58)
at org.apache.poi.poifs.filesystem.POIFSFileSystem.<init>(POIFSFileSystem.java:99)
at org.apache.poi.poifs.filesystem.POIFSFileSystem.<init>(POIFSFileSystem.java:121)
at org.apache.poi.hssf.usermodel.HSSFWorkbook.write(HSSFWorkbook.java:1357)
at Excel.main(Excel.java:12)
Caused by: java.lang.ClassNotFoundException: org.apache.commons.math3.util.ArithmeticUtils
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:636)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:182)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:519)
... 8 more
Was mache ich falsch?