0
0

【備忘録】gulp-notifyでエラーになったのでmacにjavaを入れた

Posted at

はじめに

現在進行しているプロジェクトのタスクランナーでjavaがないとエラーになる事象が発生したので入れてみた。

事象

[12:16:44] gulp-notify: [Error running Gulp] ⚠️ Nu Html Checker (v.Nu) のエラーが出ています ⚠️
The operation couldn’t be completed. Unable to locate a Java Runtime.
Please visit http://www.java.com for information on installing Java.

gulp-notifyでjavaを使ってるけど、macにjavaがないので怒られた。

javaのインストール

今回はbrewでjavaをインストールした。

java --version
The operation couldn’t be completed. Unable to locate a Java Runtime.
Please visit http://www.java.com for information on installing Java.
brew install java

インストールは完了。
バージョン確認しても、まだシンボリックをはってないのでエラーになる。

java --version
The operation couldn’t be completed. Unable to locate a Java Runtime.
Please visit http://www.java.com for information on installing Java.

シンボリックをはる。

sudo ln -sfn $(brew --prefix)/opt/openjdk/libexec/openjdk.jdk /Library/Java/JavaVirtualMachines/openjdk.jdk
java --version
openjdk 21.0.1 2023-10-17
OpenJDK Runtime Environment Homebrew (build 21.0.1)
OpenJDK 64-Bit Server VM Homebrew (build 21.0.1, mixed mode, sharing)

無事にインストール完了!
タスクランナーのエラーも消えた。

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