Guide
This charter include JDK and Java application Server: Tomcat, Jetty
Tutorial
Use Maven
A sample to use Maven
mvn archetype:generate -DgroupId=com.companyname.automobile -DartifactId=trucks -DarchetypeArtifactId=maven-archetype-webapp -DinteractiveMode=false
Web Framework
Change JDK version
Troubleshoot
Parameters
Path
Java installation directory: /data/java
Java logs directory: /data/logs/java
Tomcat install directory: /usr/local/tomcat
Tomcat configuration file: /usr/local/tomcat/conf/server.xml
Tomcat logs: /var/log/tomcat
CLI
These tools from docs: Tools and Commands Reference
- javac: You can use the
javactool and its options to read Java class and interface definitions and compile them into bytecode and class files. - javap: You use the
javapcommand to disassemble one or more class files. - javadoc: You use the
javadoctool and its options to generate HTML pages of API documentation from Java source files. - java: You can use the
javacommand to launch a Java application. - appletviewer: You use the
appletviewercommand to launch the AppletViewer and run applets outside of a web browser. - jar: You can use the
jarcommand to create an archive for classes and resources, and to manipulate or restore individual classes or resources from an archive. - jlink: You can use the
jlinktool to assemble and optimize a set of modules and their dependencies into a custom runtime image. - jmod: You use the
jmodtool to create JMOD files and list the content of existing JMOD files. - jdeps: You use the
jdepscommand to launch the Java class dependency analyzer. - jdeprscan: You use the
jdeprscantool as a static analysis tool that scans a jar file (or some other aggregation of class files) for uses of deprecated API elements.
Version
java -v
Service
# Docker
sudo docker start jdk
sudo docker stop jdk
sudo docker restart jdk
sudo docker stats jdk