JacoDB is a fast, pure Java library for accessing and analyzing Java bytecode by storing detailed class and method information in a SQLite database.
fast and effective way to access and analyze java bytecode
JacoDB is primarily used by developers and security analysts who need to inspect, analyze, and query Java bytecode outside of the JVM runtime environment. It enables detailed static analysis of Java classes, methods, fields, and annotations, facilitating vulnerability scanning and security automation workflows.
JacoDB does not support concurrent access to persistent SQLite storage from multiple processes. It is designed for static analysis and does not modify bytecode classes. Using the persistent database allows faster repeated analysis but requires careful management of database lifecycle. The tool leverages ASM and supports advanced bytecode features like control flow graphs and instruction-level analysis.
Add jacodb-api dependency: implementation(group = "org.jacodb", name = "jacodb-api", version = "1.2.0")
Add jacodb-core dependency: implementation(group = "org.jacodb", name = "jacodb-core", version = "1.2.0")
Add jacodb-analysis dependency: implementation(group = "org.jacodb", name = "jacodb-analysis", version = "1.2.0")
Alternatively, add Maven dependencies for jacodb-core, jacodb-api, and jacodb-analysis with version 1.2.0
JcDatabase database = JacoDB.async(new JcSettings().useProcessJavaRuntime()).get();
Creates an asynchronous JacoDB database instance using the current Java runtime classes.
JcClassOrInterface clazz = database.asyncClasspath(emptyList()).get().findClassOrNull("java.lang.String");
Finds the class representation of java.lang.String from the classpath.
System.out.println(clazz.getDeclaredFields());
Prints all declared fields of the retrieved class.
val database = jacodb { useProcessJavaRuntime() }
Kotlin DSL to create a JacoDB database instance using the current Java runtime.
val clazz = database.classpath().findClassOrNull("java.lang.String")
Kotlin example to find a class by name in the classpath.