Skip to main content
Fixed spelling; minor improvements for better readability.
Source Link
informatik01
  • 16.5k
  • 11
  • 82
  • 112

Under windowsWindows this works:

java -cp "Test.jar;lib/*" my.package.MainClass 

and this does not work:

java -cp "Test.jar;lib/*.jar" my.package.MainClass 

noticeNotice the *.jar*.jar, so the * wildcard should be used alone.


On Linux, the following works:

java -cp "Test.jar:lib/*" my.package.MainClass 

The separators are colonscolons instead of semicolonssemicolons.

Under windows this works:

java -cp "Test.jar;lib/*" my.package.MainClass 

and this does not work:

java -cp "Test.jar;lib/*.jar" my.package.MainClass 

notice the *.jar, so the * wildcard should be used alone.


On Linux, the following works:

java -cp "Test.jar:lib/*" my.package.MainClass 

The separators are colons instead of semicolons.

Under Windows this works:

java -cp "Test.jar;lib/*" my.package.MainClass 

and this does not work:

java -cp "Test.jar;lib/*.jar" my.package.MainClass 

Notice the *.jar, so the * wildcard should be used alone.


On Linux, the following works:

java -cp "Test.jar:lib/*" my.package.MainClass 

The separators are colons instead of semicolons.

Added an answer for linux as well.
Source Link
jamesmortensen
  • 34.2k
  • 11
  • 102
  • 124

Under windows this works:

java -cp "Test.jar;lib/*" my.package.MainClass 

and this does not work:

java -cp "Test.jar;lib/*.jar" my.package.MainClass 

notice the *.jar, so the * wildcard should be used alone.


On Linux, the following works:

java -cp "Test.jar:lib/*" my.package.MainClass 

The separators are colons instead of semicolons.

Under windows this works:

java -cp "Test.jar;lib/*" my.package.MainClass 

and this does not work:

java -cp "Test.jar;lib/*.jar" my.package.MainClass 

notice the *.jar, so the * wildcard should be used alone.

Under windows this works:

java -cp "Test.jar;lib/*" my.package.MainClass 

and this does not work:

java -cp "Test.jar;lib/*.jar" my.package.MainClass 

notice the *.jar, so the * wildcard should be used alone.


On Linux, the following works:

java -cp "Test.jar:lib/*" my.package.MainClass 

The separators are colons instead of semicolons.

Source Link
davorp
  • 4.3k
  • 3
  • 28
  • 34

Under windows this works:

java -cp "Test.jar;lib/*" my.package.MainClass 

and this does not work:

java -cp "Test.jar;lib/*.jar" my.package.MainClass 

notice the *.jar, so the * wildcard should be used alone.