[英]error: package org.apache.poi.hssf.usermodel does not exist
I have this app for XML and flatfile generation in the src folder and I have the jarFiles in Jarfiles folder.我在 src 文件夹中有这个用于 XML 和平面文件生成的应用程序,我在 Jarfiles 文件夹中有 jarFiles。
I was trying to compile my java file and I get this error: package org.apache.poi.hssf.usermodel does not exist
, I am importing this in my java file and have the jar file in the src folder.我试图编译我的 java 文件,我得到这个错误: package org.apache.poi.hssf.usermodel does not exist
,我将它导入到我的 java 文件中,并将 jar 文件放在 src 文件夹中。 How can I fix this problem?我该如何解决这个问题?
Update: I tried to include the jarfiles as the answer indicated with this line in cmd javac -cp "jarFiles/*" Xls_Reader.java
, it seems that I am still having the same error更新:我试图在 cmd javac -cp "jarFiles/*" Xls_Reader.java
中包含 jarfiles 作为这一行指示的答案,看来我仍然有同样的错误
As it seems that you are not using a build tool like Maven or Gradle, you have to make the jar part of your classpath (to get instructions on how to do that, see https://stackoverflow.com/a/49515986/16342635 .由于您似乎没有使用 Maven 或 Gradle 之类的构建工具,因此您必须将 jar 作为类路径的一部分(要获取有关如何执行此操作的说明,请参阅https://stackoverflow.com/a/49515986/16342635 .
However, I would recommend getting familiar with a build tool like Maven and to manage your dependencies (your "jar files") with that.但是,我建议您熟悉 Maven 之类的构建工具并使用它来管理您的依赖项(您的“jar 文件”)。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.