在Jcreator中添加jar [英] adding jar in Jcreator
问题描述
我想通过在jcreator编辑器中编写java代码来阅读doc文件。为此,我想使用Apache POI jar文件。
但我不知道如何在Jcreator编辑器中添加jar文件。我的文件结构是这样的:
现在我指的是使用此代码。
import org.apache.poi.poifs.filesystem。*;
import org.apache.poi.hpsf.DocumentSummaryInformation;
import org.apache.poi.hwpf。*;
import org.apache.poi.hwpf.extractor。*;
import org.apache.poi.hwpf.usermodel.HeaderStories;
但Jcreator向我显示此错误。
H:\Code For others\chat\docx file\ReadDocFileFromJava.java:1:package org.apache .poi.poifs.filesystem不存在
import org.apache.poi.poifs.filesystem。*;
^
H:\Code For others\chat\docx file\ReadDocFileFromJava.java:2:package org.apache.poi.hpsf不存在
import org.apache .poi.hpsf.DocumentSummaryInformation;
^
H:\Code For others\chat\docx file\ReadDocFileFromJava.java:3:package org.apache.poi.hwpf不存在
import org.apache .poi.hwpf *。
为什么Jcreator会显示此错误?如何清除此错误? 和 Apache POI 为了让它正常工作,所以密切关注哪些软件包仍未找到按照上述步骤构建
I want to read doc file by writing java code in jcreator editor . For this purpose , I want to use Apache POI jar file .
But I don't know how to add jar file in Jcreator editor . My file structure is like this :
Now I am referring using this code .
import org.apache.poi.poifs.filesystem.*;
import org.apache.poi.hpsf.DocumentSummaryInformation;
import org.apache.poi.hwpf.*;
import org.apache.poi.hwpf.extractor.*;
import org.apache.poi.hwpf.usermodel.HeaderStories;
But Jcreator is showing this error to me .
H:\Code For others\chat\docx file\ReadDocFileFromJava.java:1: package org.apache.poi.poifs.filesystem does not exist
import org.apache.poi.poifs.filesystem.*;
^
H:\Code For others\chat\docx file\ReadDocFileFromJava.java:2: package org.apache.poi.hpsf does not exist
import org.apache.poi.hpsf.DocumentSummaryInformation;
^
H:\Code For others\chat\docx file\ReadDocFileFromJava.java:3: package org.apache.poi.hwpf does not exist
import org.apache.poi.hwpf.*;
Why is the Jcreator showing this errors ? What do I do to remove this error ? I am following thus tutorial for doc file reading .
Highlight the current project:
Click on the properties button:
Click on the
Required Libraries
tab, then clickNew
:Give the library an appropriate name, then click
Add
->Add Archive
:Use the navigator to select the
.jar
file, then clickOK
on the Set Library window.Ensure the libraries are checked, then click
OK
:
After this, the project should build correctly.
Note
I couldn't locate the library with the exact name yours had, but when I went looking for them I had to download both POI Scratchpad and Apache POI in order to get it working, so pay close attention to exactly which packages aren't found if it still doesn't build when you follow the steps above
这篇关于在Jcreator中添加jar的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!