Java CLI
-version
# Java version
java -version
-
- You must be in the directory of the file/class which you want to run in order to run it
- It sets the current directory as the
classpath
# Compile and run source code
cd ./Documents; java "Main.java"
# Run a compiled code
cd "~/Documents"; java "Main"
-D
java -D"key"="value" "Main"
java -Dfile.encoding=UTF-8 "Main"
java -Dserver.port "Main"
-cp
java -cp "~/Documents" "Main"
-jar
java -jar "avro-tools-1.10.2.jar"
-agentlib
java -agentlib:jdwp=transport=dt_socket,server=n,suspend=y,address=localhost:38585 "Main"