Compile Java at the command prompt

I had a chance to compile and execute java on the command prompt of windows, and I had a hard time, so I summarized it.

javac ...java compile command
① Use cd to move to the location of the java file you want to compile.
② Compile
//For classes without packages
javac Test.java

//For classes with packages
javac pacakage.Test.java

//If you want to compile by referring to the jar library
* When specifying the jar, use the full path
javac -classpath C¥test.jar; pacakage.Test.java

//If you want to change the output destination of the compiled class file
* Before specifying the java file,-Specify the output destination with d,
javac -classpath C¥test.jar; -d C¥local¥classes pacakage.Test.java

Recommended Posts

Compile Java at the command prompt
Java passes at the command prompt, but javac does not
Compile and run Java on the command line
When a Java file created with the Atom editor is garbled when executed at the command prompt
The problem that the JDK set in JAVA_HOME does not appear even if java -version is performed at the command prompt
java jar classpath command
Connecting Java application and PostgreSQL with JDBC without using eclipse (execute at command prompt)
Introduction to java command
Java Lambda Command Pattern
Command to check the number and status of Java threads
[Java] To know the type information of type parameters at runtime
Oracle Java Trends 2018 = Quick Summary = (Looking at the Oracle JDK 11 Release)
[Java] final override error is not displayed at compile time
The Java Primer passed the blockage
java hello world, compile, run
Decomposing the Docker run command. .. ..
[Java] I implemented the combination.
Java is the 5th day
I studied the constructor (java)
Input to the Java console
[Java] Adding an element to the Collection causes a compile error
Java Converts disparate character codes to the same character code at once
To use the "java" command line tool ... How to avoid popping up
A quick look back at Java over the last five years