Skip to content

Latest commit

 

History

History
66 lines (46 loc) · 1.33 KB

java.md

File metadata and controls

66 lines (46 loc) · 1.33 KB

Java

NOT PORTED YET.

Show Java Classpath

Since the java -cp / java -classpath is one huge string of colon separated paths, it's nicer to show them one per line using the scripts in DevOps-Bash-tools or DevOps-Perl-tools repos:

java_show_classpath.sh
java_show_classpath.pl

Crude shell pipeline to do similar:

ps -ef |
grep java |
tee /dev/stderr |
awk '{print $2}' |
xargs -L1 jinfo |
grep java.class.path  |
tr ':' '\n'

although if it's just jinfo you're missing in the $PATH it would be better to just:

PATH="$PATH:/path/to/bin/containing/jinfo" java_show_classpath.sh

Inspect JAR contents

Java jar files are just tars of the byte-compiled Java classes.

You can inspect them using the good old unix tar command, eg.:

tar tvf mysql-connector-j-*.jar

The directory layout of the class files corresponds to the class hierarchy eg. is accessed as com.mysql.jdbc.Driver in Java code.

Clojure

https://clojure.org/

Just a jar, no dependency like Scala predef.

java -jar my.jar
Ported from various private Knowledge Base pages 2010+