1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Spring Initializrで作成した雛形がbootRunで起動しなくて困ったメモ

Posted at

起きたこと

Spring Initializr

で雛形を作りダウンロード。

  • Generate a [Gradle Project] with [Kotlin] and Spring Boot [1.5.10]
  • Project Metadata [com.example] [demo]
  • Dependencies [Web] [Thymeleaf]

bootRunを実行

./gradlew bootRun

なぜか java.lang.ClassNotFoundException で落ちてしまう。

対応

build.gradleorg.jetbrains.kotlin:* を削除したら動いた。

別の時にダウンロードした雛形には org.jetbrains.kotlin:* がなくて動いていたので消してみました。

  • 修正前
build.gradle
dependencies {
	compile('org.springframework.boot:spring-boot-starter-thymeleaf')
	compile('org.springframework.boot:spring-boot-starter-web')
	compile('com.fasterxml.jackson.module:jackson-module-kotlin')
	compile("org.jetbrains.kotlin:kotlin-stdlib-jdk8:${kotlinVersion}")
	compile("org.jetbrains.kotlin:kotlin-reflect:${kotlinVersion}")
	testCompile('org.springframework.boot:spring-boot-starter-test')
}
  • 修正後
build.gradle
dependencies {
	compile('org.springframework.boot:spring-boot-starter-thymeleaf')
	compile('org.springframework.boot:spring-boot-starter-web')
	compile('com.fasterxml.jackson.module:jackson-module-kotlin')
	testCompile('org.springframework.boot:spring-boot-starter-test')
}

とりあえず動いたがなぜかは不明なのであとで調べる。

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?