我有一个简单的项目,有一个类:
apply plugin: 'java'
repositories {
mavenLocal()
mavenCentral()
}
dependencies {
implementation 'joda-time:joda-time:2.2'
}
我使用 build.gradle 文件来构建项目:
gradle build
d:\Spring\test\TestProject>gradle build
Download https://repo.maven.apache.org/maven2/joda-time/joda-time/2.2/joda-time-2.2.pom
Download https://repo.maven.apache.org/maven2/joda-time/joda-time/2.2/joda-time-2.2.jar
BUILD SUCCESSFUL in 4s
2 actionable tasks: 2 executed
似乎是从控制台成功执行的:
Exception in thread "main" java.lang.Error: Unresolved compilation problems:
LocalTime cannot be resolved to a type
LocalTime cannot be resolved to a type
at hello.HelloWorld.main(HelloWorld.java:8)
但是当我尝试使用以下配置在Eclipse IDE中运行应用程序时:
发生错误:
gradle clean
我试图在控制台中执行gradle build
,然后再次{{1}},然后尝试再次在Eclipse中运行应用程序,但没有任何改变。
为什么会这样?以及如何解决它?