Technology choices
OpenRocket was originally written in Java because Java is platform-independent — the same JAR runs on Windows, macOS, and Linux without modification. While Java desktop applications are less common today, Java’s mature ecosystem of libraries and tools makes it a practical choice for a project of this complexity. OpenRocket is released under the GNU General Public License v3.0, which ensures the source code remains open and free.Java Platform Module System (JPMS)
OpenRocket uses JPMS to divide the codebase into two explicitly declared modules. Each module is described by amodule-info.java file at the root of its source tree (<module>/src/main/java/module-info.java). The file declares:
- Module name — a unique identifier (e.g.,
info.openrocket.core) - Dependencies — other modules this module requires
- Exported packages — packages accessible to other modules
- Services — service interfaces provided or consumed by the module
Strong encapsulation
Modules explicitly control which packages they expose. Internal implementation details are hidden from other modules.
Reliable configuration
The module system verifies dependencies at compile time and runtime, preventing missing or incompatible components.
Independent development
Modules can be developed and tested in isolation, making the codebase easier to understand and evolve.
Scalability
The modular structure makes it easier to add new features or replace components without impacting the whole application.
The two modules
info.openrocket.core
The core module contains the simulation backend. It has no dependency on any GUI toolkit, which means it can be embedded in other applications that need rocket simulation capabilities.
Key responsibilities:
- Rocket component model (
rocketcomponentpackage) - Aerodynamic calculations using the Barrowman method (
aerodynamicspackage) - Flight simulation engine with RK4 integration (
simulationpackage) - Mass and CG calculations (
masscalcpackage) - File format parsers and writers:
.ork,.orc, RockSim, RASAero II (filepackage) - Motor and thrust curve database (
motor,thrustcurvepackages) - Component preset database (
presetpackage) - Physical models: atmosphere, gravity, wind (
modelspackage) - Optimization engine (
optimizationpackage) - Localization (
l10npackage) - Unit conversion (
unitpackage)
core/src/main/java/module-info.java:
info.openrocket.swing
The swing module contains the graphical user interface. It depends on info.openrocket.core with a requires transitive declaration, which means code that requires info.openrocket.swing also automatically gets access to info.openrocket.core.
Key responsibilities:
- Main application window and component tree (
gui/mainpackage) - Component configuration dialogs (
gui/configdialogpackage) - 2D rocket figure rendering (
gui/rocketfigurepackage) - 3D visualization with JOGL (
gui/figure3dpackage) - Simulation results plots (
gui/plotpackage) - Motor selection dialogs (
gui/dialogs/motorpackage) - Optimization dialogs (
gui/dialogs/optimizationpackage) - Printing (
gui/printpackage) - UI theming with FlatLaf (
gui/themepackage) - Application startup and Guice wiring (
startuppackage)
Dependency injection with Google Guice
OpenRocket uses Google Guice for dependency injection throughout both modules. Guice eliminates manual object construction and wiring, making components easier to test and replace. The application is bootstrapped in thestartup package of both modules. Guice Module classes define the bindings — which interface maps to which implementation — and an Injector is created at startup.
The
info.openrocket.core module declares Guice service interfaces using uses and provides directives in module-info.java. For example, OptimizableParameterService and SimulationModifierService are loaded through the JPMS service loader mechanism.Key third-party libraries
| Library | Purpose |
|---|---|
| Google Guice 7 | Dependency injection |
| FlatLaf | Modern Swing look-and-feel with light and dark themes |
| JOGL (JogAmp) | OpenGL-based 3D rocket rendering |
| JFreeChart | Simulation results plots |
| GraalVM JS | JavaScript scripting for simulation extensions |
| JAXB (Jakarta XML Binding) | .orc file serialization/deserialization |
| SLF4J + Logback | Logging |
| JTS (locationtech) | Geometry operations |
| MigLayout | Swing panel layout |
Thrust curves
OpenRocket uses ThrustCurve.org as the source for its motor thrust curve database. Motor data is serialized into a SQLite database file (thrustcurves.db) bundled with the application. The serializeEngines Gradle task fetches and rebuilds this database from the source files.
Units
All internal calculations use pure SI units: meters, kilograms, seconds, Kelvin, radians, and so on. This convention also applies to values stored in.ork files. The only exceptions are:
- Angles in
.orkfiles — stored in degrees for human readability, even though radians are used internally. - Launch site coordinates — latitude and longitude are in degrees both internally and in the file.
info.openrocket.core.unit package converts between SI and the user’s preferred units. The Unit class represents a single unit with conversion methods, and UnitGroup groups related units for a measurable quantity (e.g., temperature: Celsius, Fahrenheit, Kelvin).