Java Doc Idiocy: -cp -classpath Not in Man Page

By Xah Lee. Date:

to load a particular class, you are adviced to use -cp.

for example, from clojure getting started page, quote:

java -cp clojure-1.6.0.jar clojure.main
clojure website install java -cp
Clojure website on 「-cp」 screenshot

also from official java documentation at

java doc classpath 2014-10-27
Java documentation website screenshot on 「-cp」

Using the JDK tools' -classpath option

The JDK tools java, jdb, javac, and javah have a -classpath option which replaces the path or paths specified by the CLASSPATH environment variable while the tool runs. This is the recommended option for changing class path settings, because each application can have the class path it needs without interfering with any other application.

The runtime tool java has a -cp option, as well. This option is an abbreviation for -classpath.

However, if you do man java, the option -cp or -classpath is not mentioned.

for a record of history for posterity, here's the entire java man page (Java SE 8), in glorious 2116 lines: java_man_page_2014-10-27.txt

Ask me question on patreon