34 releases (22 breaking)

Uses new Rust 2024

0.24.2 Dec 24, 2025
0.22.0 Nov 9, 2025
0.20.2 Jul 8, 2025
0.18.0 Feb 21, 2025
0.6.0 Nov 14, 2023

#512 in Parser implementations

MIT license

580KB
14K SLoC

MokaPot

Crates.io docs.rs

Overview

MokaPot is a Rust library for working with JVM bytecode. You can use it to parse, inspect, and analyze Java class files.

Main features:

  • Parse JVM bytecode
  • Work with an intermediate representation (MokaIR)
  • Build custom tools for JVM bytecode
  • Includes documentation and examples

Documentation

Installation

To add MokaPot to your project, run:

cargo add mokapot

To use the latest commit from GitHub:

cargo add --git https://github.com/henryhchchc/mokapot.git mokapot
cargo update

Usage

Parse a JVM class file

use mokapot::jvm::class::Class;
use std::fs::File;

fn parse_class_file(path: &str) -> Result<Class, Box<dyn std::error::Error>> {
    let mut file = File::open(path)?;
    let class = Class::from_reader(&mut file)?;
    Ok(class)
}

More Examples

See the examples directory for more code samples.

MokaIR

MokaIR is an intermediate representation of JVM bytecode in this library. See docs/MokaIR.md for details.

Contributing

See the project repository for contributing guidelines.

License

MIT License. See LICENSE for details.

Dependencies

~4–6.5MB
~116K SLoC