5
0

More than 3 years have passed since last update.

gradle buildがwindowsでjava.nio.file.InvalidPathException: Illegal char <:> at indexというエラーになる

Posted at

gradle buildをwindowsで実行したところ以下のようなエラーになった。以下エラー中のファイルパスは適当なものに書き換えている。

* What went wrong:
Execution failed for task ':api:compileJava'.
> java.nio.file.InvalidPathException: Illegal char <:> at index 71: /usr/local/xxx/lib/aaa.jar:/xxx/bbb.jar:/usr/local/xxx/ccc.jar

原因は依存性の中のあるjarのマニフェストファイルのClass-Pathだった。ここに以下のように":"(コロン)区切りでファイルパスが指定されていた。クラスパスは、Linuxでは区切り文字は":"(コロン)だが、windowsでは";"(セミコロン)、で指定しなければならない。よって、windowsでだけビルドエラーになる。

Class-Path: /usr/local/xxx/lib/aaa.jar:/xxx/bbb.jar:/usr/local/xxx/ccc.jar

対策としては、excludeするとか、問題のあるjarを作り直すとか、になる。

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