使用Apache POI库创建Excel文件时出错。

时间:2022-09-12 20:23:54

Here is my code:

这是我的代码:

import org.apache.poi.hslf.HSLFSlideShow;

import org.apache.poi.hslf.model.Slide;

import org.apache.poi.hslf.usermodel.SlideShow;  
import java.io.*;  


public class CreateNewPresentation  
{  
    public static void main(args[])  
    {  
        try  
        {  
            SlideShow slideShow = new SlideShow();  
            Slide slide = slideShow.createSlide();  
            FileOutputStream out = new  
                FileOutputStream("slideshow.ppt");  
            slideShow.write(out);  
            System.out.println("File Created...");  
            out.close();  
        }  
        catch(Exception e)  
        {  
            e.printStackTrace();  
        }  
    }  
}  

The issue is that it does not recognise org.apache.poi package.

问题是它无法识别org.apache.poi包。

How can I make it work?

我怎样才能使它工作?

1 个解决方案

#1


0  

If you are using netbeans, refer this for setting classpath. If you want to set classpath from command line refer this

如果您使用netbeans,请参阅此设置classpath。如果要从命令行设置classpath,请参阅此处

#1


0  

If you are using netbeans, refer this for setting classpath. If you want to set classpath from command line refer this

如果您使用netbeans,请参阅此设置classpath。如果要从命令行设置classpath,请参阅此处