问题描述
我有一个动态 Web 项目,我正在将一个 jsp/servlet 应用程序从 JRun 迁移到 Tomcat.
I have a dynamic web project that I am working on to migrate a jsp/servlet app from JRun to Tomcat.
我收到错误:com.ibm.ivj.eab.dab.DatastoreJDBC
无法解析为类型.
I am getting the error: com.ibm.ivj.eab.dab.DatastoreJDBC
cannot be resolved to a type.
我将 *.class
文件放在 com/ibm/ivj/eab/dab
文件夹中(正是我找到它们的方式).我尝试创建一个 jar 文件并通过添加外部 Jar"将其添加到构建路径中,我还尝试添加一个外部类文件夹"并指向包含相关com"目录的文件夹.
I have the *.class
files sitting inside a com/ibm/ivj/eab/dab
folder (exactly how I found them). I have tried creating a jar file and adding that to the build path via "Add External Jar", I have also tried adding an "External Class Folder" and pointing to the folder that contains the "com" directory in question.
但是,错误仍然存在.奇怪的是,如果我开始输入包名 eclipse 实际上为我自动完成了课程!(如下图).任何想法将不胜感激.也许这些类是为更旧的 Java 版本编译的,这会引起麻烦吗?也许我需要做些什么来确保这些类最终出现在 WEB-INF/lib 目录中?
Still, the error persists. What is strange is if I start typing the package name eclipse actually auto-completes the class for me! (pictured below). Any ideas would be greatly appreciated. Maybe the classes were compiled for a much older java version and that is causing trouble? Maybe there is something I need to do to ensure the classes end up in the WEB-INF/lib directory?
I
推荐答案
右键单击您的项目名称.
Right click your project name.
点击属性
.
点击Java Build Path
.
点击添加类文件夹
.
然后选择你的班级.
或者,Add Jars
应该可以工作,尽管您声称您尝试过.
Alternatively, Add Jars
should work although you claim that you attempted that.
此外,您是否尝试过将其关闭并重新打开"?(重启 Eclipse).
Also, "have you tried turning it off and back on again"? (Restart Eclipse).
这篇关于Eclipse 错误...无法解析为类型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!