英文:
Eclipse error … 'cannot be resolved to a type'
问题
以下是翻译好的部分:
我正在尝试使用Eclipse IDE运行一个项目。
该项目创建于2015年,我试图使用仍然在互联网上可用的命令。
我卡在以下错误信息上:
异常线程"main"java.lang.Error:未解析的编译问题:当前
无法将Database解析为类型
类型AbstractModule的方法bind(Class<Database>)引用了缺失的类型Database
无法将Database解析为类型
类型AbstractModule的方法bind(Class<RouteRepository>)引用了缺失的类型RouteRepository
RouteRepository无法解析为类型
RouteRepository无法解析为类型
类型AbstractModule的方法bind(Class<SimulationRepository>)引用了缺失的类型SimulationRepository
SimulationRepository无法解析为类型
SimulationRepository无法解析为类型
类型AbstractModule的方法bind(Class<MeasurementRepository>)引用了缺失的类型MeasurementRepository
MeasurementRepository无法解析为类型
MeasurementRepository无法解析为类型
请问您能否给我一些建议,帮助我解决这个问题?
我已经完成了以下步骤:
- 安装了Java jdk-8.0.242.08和Java jre1.8.0_241;
- 安装了Eclipse IDE和所需的软件:Eclipse Git团队提供程序; JGit; 适用于Eclipse的Maven集成; Web; XML; Java EE。
- 从以下网址克隆了GIT存储库:https://github.com/andreaswolf/graphhopper 和 https://github.com/andreaswolf/roadhopper
- 导入现有的Maven项目。
- 运行一个具有以下特点的新的JAVA应用程序:
主类:info.andreaswolf.roadhopper.server.RoadHopperServer
VM选项:-Djetty.port=8989 -Dconfig.file=./roadhopper/application.conf -Dorientdb.config.file=./roadhopper/orientdb/orientdb-server-config.xml -DORIENTDB_HOME=./roadhopper/orientdb/
程序参数:config=./config.properties
工作目录:GraphHopper路径
英文:
I am trying to run a project using Eclipse IDE.
The project was created in 2015, and I am trying to use the commands that are still available on the internet.
I am stuck on the following error messages:
Exception in thread "main" java.lang.Error: Unresolved compilation problems: currently
Database cannot be resolved to a type
The method bind(Class<Database>) from the type AbstractModule refers to the missing type Database
Database cannot be resolved to a type
The method bind(Class<RouteRepository>) from the type AbstractModule refers to the missing type RouteRepository
RouteRepository cannot be resolved to a type
RouteRepository cannot be resolved to a type
The method bind(Class<SimulationRepository>) from the type AbstractModule refers to the missing type SimulationRepository
SimulationRepository cannot be resolved to a type
SimulationRepository cannot be resolved to a type
The method bind(Class<MeasurementRepository>) from the type AbstractModule refers to the missing type MeasurementRepository
MeasurementRepository cannot be resolved to a type
MeasurementRepository cannot be resolved to a type
COuld you please give me any advices that could help me solving this issue?
I have already completed the following steps:
- Installed Java jdk-8.0.242.08 and Java jre1.8.0_241;
- Installed Eclipse IDE and the required softwares: Eclipse Git Team Provider; JGit; Maven Integration for Eclipse; Web; XML; Java EE.
- Cloned GIT repository from: https://github.com/andreaswolf/graphhopper and https://github.com/andreaswolf/roadhopper
- Import Existing Maven Projects.
- Run a new JAVA application program with the following characteristics:
Main class: info.andreaswolf.roadhopper.server.RoadHopperServer
VM options: -Djetty.port=8989 -Dconfig.file=./roadhopper/application.conf - Dorientdb.config.file=./roadhopper/orientdb/orientdb-server-config.xml - DORIENTDB_HOME=./roadhopper/orientdb/
Program arguments: config=./config.properties
Working directory: Path to GraphHopper
答案1
得分: 0
可能包含Database、RouteRepository、SimulationRepository、MeasurementRepository类的依赖项没有从Maven仓库或本地仓库上传,或者您没有将该依赖项添加到主项目中。
- 您能检查这些类,并找出它们来自何处吗?
- 然后在pom.xml文件中检查其源代码,作为依赖项,或者在构建路径配置中检查其作为源代码库。
英文:
Probably the dependency that contains the classes Database, RouteRepository, SimulationRepository, MeasurementRepository did not uploads from maven repository, or local repository, or you did not add it dependency to your main project.
- Could you check this classes and figure out where did they come from.
- Then check it's source in pom.xml file as dependencies or check in build path configuration as source library.
专注分享java语言的经验与见解,让所有开发者获益!
评论