5
7

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.

環境別Classpathの指定方法一覧

Last updated at Posted at 2015-02-03

JavaのClasspathを、特に複数指定する場合の方法について。

環境によって少しずつクセがあります。

Linuxの場合

java -cp WEB-INF/classes:WEBINF/lib jp.hoge.Hoge

複数指定する場合は、コロン(:)で連結します。

Windows(コマンドプロンプト)の場合

java -cp WEB-INF\classes;WEBINF\lib jp.hoge.Hoge

複数指定する場合は、セミコロン(;)で連結します。
パスの指定はWindows形式、すなわちスラッシュ(/)ではなく円記号(\)で!

Cygwinの場合

java -cp WEB-INF/classes\;WEBINF/lib jp.hoge.Hoge

複数指定する場合は、セミコロン(;)で連結しますが、円記号でエスケープが必要です!
そして、パスの指定はLinux形式。

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?