0
0

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.

【groovy】実行するポートを指定(変更)する方法

Posted at

groovyスクリプトをポート8080で上手く接続できない、エラーが出る場合の対処方法です。

ポート9000で実行する場合の例

コマンドプロンプト(ターミナル)で以下のように入力します。

spring run test.groovy -- --server.port=9000

問題なく実行できたら以下のURLで実行結果を確認しましょう。

http://localhost:9000/

参考:実行ソース例

ファイル名:test.groovy

hello.php
@RestController

class App{
  @RequestMapping("/")
  def home(){
  "Hello!"
  }
}

参考:JVMオプションを指定して実行する

JAVA_OPTS=-Xmx1024m spring run test.groovy

参考:https://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#cli-run

0
0
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
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?