Hi,
I am trying to open an existing ods file using java but i am getting this error.
Here is My code:
import java.io.File;
import java.io.IOException;import java.io.*;
import com.aspose.cells.Workbook;
import com.aspose.cells.*;
import com.aspose.cells.Worksheet;
public class ReadODSaspose {
public static void main(String[] args) {
try {
//Instantiating a Workbook object
Workbook workbook = new Workbook();
//Creating a file stream containing the Excel file to be opened
FileInputStream fstream = new FileInputStream(“C:\data1.ods”);
//Opening the Excel file through the file stream
workbook.open(fstream, FileFormatType.ODS);
//Accessing the first worksheet in the Excel file
Worksheet worksheet = workbook.getWorksheets().getSheet(0);
//Closing the file stream to free all resources
fstream.close();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
// Change date.
}
}
Error Msg:-
Exception in thread “main” java.lang.NoClassDefFoundError: com/aspose/cells/gD (
wrong name: com/aspose/cells/gd)
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:616)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:12
4)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
at java.net.URLClassLoader.access$000(URLClassLoader.java:56)
at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:303)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:316)
at ReadODSaspose.main(ReadODSaspose.java:22)
Please Help me.
Hi,
Please share your template ODS file and which version you are using?
We will check your issue soon.
Thank you.
Hi I am Using Openoffice 3.2.0 Version
Hi
Attached the data1.ods for your Reference I am Using the openoffice 3.2.0 Version.
Thanks.