Building Blocks Flashcards
Java compile command?
javac
What is compiler command for setting the compile output directory?
-d
How does typical compile command look like? What are its parts?
- -d for output directory
- name of class we compile or package path to class or package path with * for all classes in that package
- -cp or -classpath or –class-path for dependency folder or folder where is application built
How to set classpath location while using compiler command and all its variants?
-cp
-classpath
–class-path
How to run Java application using CLI?
java
What do you need to provide “java” command to run Java application?
Package path to class that has main method we want to run, and complete classpath
How do text block look like?
”””
text block”””
Note: it needs to have first line below opening quotes!
In text blocks, how do we request a new line in output?
\n
In text blocks, how do we request not to add a new line?
\
In text blocks, how do we escape characters?
\ and some character
eg. "
In text blocks, how do we request two spaces in output?
\s
What is command to JAR a Java application?
jar
How do we choose dependency folder while using “jar” command?
-c
How do we JAR a Java application?
jar -cvf JarName.jar -c dependency/folder .
What is alternative to “-cvf”
–create –verbose –file