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 1 year has passed since last update.

Gradleのコマンドが実行できない

Posted at

プログラミング初学者です。
Gradleのインストールにつまずいたので、備忘録を共有します。

対象の読者

Gradleをインストールしたはずが、コマンドの実行がうまくいかない
Gradleの環境変数の設定が分からない

発生した問題

正しく環境変数を設定したはずなのに、コマンドプロンプトでGradleコマンドを実行するとエラーが出ました。

環境変数設定の際参考にした記事

この通りに設定したはずで、誤字脱字もありませんでした。

エラーメッセージ

Error opening zip file or JAR manifest missing: C:\gradle-8.2.1/lib/agents/gradle-instrumentation-agent-8.2.1.jar
Error occurred during initialization of VM
agent library failed to init: instrument

原因

参照しに行ったディレクトリが存在しなかった
C:\gradle-8.2.1/lib/agentsディレクトリにgradle-instrumentation-agent-8.2.1.jarというjarファイルがないことが原因と、エラーメッセージを見ると読み取れます。

解決のためにやったこと

①ディレクトリの存在を確認
エラーメッセージに出たパスをもとにlibディレクトリの直下を見に行きましたがagentsディレクトリが存在しませんでした...
(なぜなのかはわからない。展開途中で中断でもしてしまったのか...)

②再度gradle-8.2.1-bin.zipをダウンロードして展開
ダウンロードしたzipを展開し直し中身を確認したらagentディレクトリが存在し、jarファイルもありました。

③環境変数の設定を再度確認し、cmdでgradleコマンドを打ってみる

Welcome to Gradle 8.2.1!

キターーー!解決です。
何はともあれGradleが使えるようになりそうで、よかったです。

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?