NOT PORTED YET.
- Books
- SDKman - Install and Manage Multiple Versions of Java at the same time
- Show Java Classpath
- Inspect JAR contents
- JKS - Java Key Store (SSL)
- Java Decompilers
- Libraries
- JShell
- JBang
- GraalJS
- Clojure
- ProGuard
- JVM Distributions
- Memes
See SDKman page.
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.shjava_show_classpath.plCrude 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.shJava jar files are just tars of the byte-compiled Java classes.
You can inspect them using the good old unix tar command, eg.:
jar tf mysql-connector-j-*.jaror
tar tvf mysql-connector-j-*.jarThe directory layout of the class files corresponds to the class hierarchy eg.
is accessed as com.mysql.jdbc.Driver in Java code.
See SSL doc.
Use these to decompile JAR or .class files to read the Java source code.
Using DevOps-Bash-tools repo:
For a GUI:
jd_gui.sh "$jar_or_class_file"or
bytecode_viewer.shFor command line output:
cfr.sh "$jar_or_class_file"or
procyon.sh "$jar_or_class_file"Some libraries of interest:
- Faker - generates fake but realistic data for unit testing
Package repo for JVM and Android projects.
Builds Git projects on demand and provides ready-to-use artifacts (jar, aar).
To check if a Jitpack dependency target is valid:
GITHUB_REPO="markomilos/paginate"
VERSION="v1.0.0"curl -IsSLf "https://jitpack.io/com/github/$GITHUB_REPO/$VERSION/${GITHUB_REPO##*/}-$VERSION.jar"
For an Android dependency, check for the .aar artifact instead of .jar
curl -IsSLf "https://jitpack.io/com/github/$GITHUB_REPO/$VERSION/${GITHUB_REPO##*/}-$VERSION.aar"Check build log to show what was built by JitPack:
curl "https://jitpack.io/com/github/$GITHUB_REPO/$VERSION/" && echoCommand line or interactive Java Shell.
Java 9+:
$ jshell
| Welcome to JShell -- Version 21.0.4
| For an introduction type: /help intro
jshell>See also Groovy which is one of my favourite languages and has a shell:
groovyshPackages executable self-contained source-only Java programs.
Install using SDKman:
sdk install jbangCreate a source code CLI program:
jbang init -t cli hellocli.javaReading the source code it shebangs jbang and annotates the class with some metadata for jbang.
The first run downloads the dependencies mentioned in the source code
$ ./hellocli.java --help
[jbang] Resolving dependencies...
[jbang] info.picocli:picocli:4.6.3
[jbang] Dependencies resolved
[jbang] Building jar for hellocli.java...
Usage: hellocli [-hV] <greeting>
hellocli made with jbang
<greeting> The greeting to print
-h, --help Show this help message and exit.
-V, --version Print version information and exit.$ ./hellocli.java JBANG!
Hello JBANG!Automatic fetches any dependencies referenced in the source code using //DEPS group:artifact:version comments
or @Grab annotations.
Even downloads a JDK if needed.
This makes portable Java scripting easier.
jbang -c 'Java_code'Example of JBang CLI using Faker library to output random names:
// DEPS com.github.javafaker.javafaker:1.0.2
import com.github.javafaker.Faker
Faker faker = new Faker()cat > /tmp/faker.java <<EOF
//usr/bin/env jbang "$0" "$@" ; exit $?
//DEPS com.github.javafaker:javafaker:1.0.2
import com.github.javafaker.Faker;
import java.util.stream.Stream;
public class faker {
public static void main(String[] args) {
Faker faker = new Faker();
Stream.generate(faker.name()::fullName)
.filter(s -> s.contains("Hari"))
.forEach(s -> System.out.println(s + " is Awesome"));
}
}
EOFjbang /tmp/faker.javaSee also Groovy which is one of my favourite languages and wish I had more excuses to code it in other than:
JavaScript engine running on JVM via GraalVM.
ECMAScript-compliant runtime to execute JavaScript and Node.js applications on JVM with benefits of GraalVM stack including interoperability with Java.
Just a jar, no dependency like Scala predef.
java -jar my.jarhttps://www.guardsquare.com/proguard
https://www.guardsquare.com/manual/home
https://playground.proguard.com/
Shrinker, optimizer, and obfuscator for Java and Kotlin code.
GuardSquare/proguard-assembler
GuardSquare/kotlin-metadata-printer
https://www.guardsquare.com/ixguard
Obfuscates iOS code. See iXGuard page.
These are the options you'll see when you install SDKman and sdk list java.
Temurin is the default open source distribution that SDKman uses.
Amazon's OpenJDK distribution with long-term support and performance enhancements.
https://aws.amazon.com/corretto/
Mobile-focused OpenJDK distribution optimized for JavaFX applications.
https://gluonhq.com/products/mobile/
High-performance JDK with ahead-of-time compilation and polyglot capabilities.
Official OpenJDK reference builds provided by Oracle.
Custom JDK distribution optimized for JetBrains IDEs.
Full OpenJDK distribution with JavaFX support from BellSoft.
GraalVM-based JDK optimized for Quarkus applications.
Microsoft's OpenJDK distribution with enterprise support.
https://learn.microsoft.com/en-us/java/openjdk/
Official Oracle JDK with commercial support and licensing requirements.
https://www.oracle.com/java/technologies/downloads/
SAP's OpenJDK distribution optimized for SAP workloads.
https://sap.github.io/SapMachine/
IBM's OpenJDK distribution with Eclipse OpenJ9 for performance optimizations.
https://developer.ibm.com/languages/java/semeru-runtimes/
Community-driven OpenJDK distribution maintained by Adoptium.
Tencent's OpenJDK distribution optimized for cloud environments.
Azul's OpenJDK distribution with commercial support and JavaFX options.
https://www.azul.com/downloads/zulu/
Ported from various private Knowledge Base pages 2010+




