Setting up the JAR file search location for the java command line tool

Before I forget it again: usually, Command-Line Java applications set up their classpath using the -classpath argument, which requires you to specify each single jar, among the root package directory where .class files are in. I find this method boring and slow to set up, specially when you have dozens of files.

A much better approach is to use the option -Djava.ext.dirs=<directory> instead, as in

java -Djava.ext.dirs=/path/to/all/jars com.my.Application

Just point to the root directory where all your jars are located. Way more useful and using the -classpath argument.