Integrate the OpenRocket core module into your own Java applications without any Swing GUI dependencies.
The OpenRocket core module provides the fundamental rocket simulation functionality as a standalone library. You can embed it in your own Java applications to design rockets, run simulations, and load or save .ork files — all without any GUI code.The core module includes:
If you need full control over the initialization process, you can configure the Guice injector directly:
import info.openrocket.core.startup.Application;import info.openrocket.core.startup.CoreModule;import info.openrocket.core.plugin.PluginModule;import com.google.inject.Guice;import com.google.inject.Injector;public class MyApplication { public static void main(String[] args) { // Create the core module CoreModule coreModule = new CoreModule(); // Create injector with required modules Injector injector = Guice.createInjector( coreModule, new PluginModule() ); // Set the injector in the Application class Application.setInjector(injector); // Start loading databases coreModule.startLoader(); // Now you can use OpenRocket functionality }}
Call OpenRocketCore.initialize() exactly once at application startup. Multiple calls are safe but unnecessary.
Handle exceptions
Database loading can fail if resource files are missing. Wrap initialization in try/catch and handle failures gracefully.
Use dependency injection
Access services through Application.getInjector() rather than instantiating them directly.
Monitor memory
OpenRocket loads significant data at startup. Monitor heap usage in long-running applications and consider using the bypass properties when data is not needed.
You called an OpenRocket API before calling OpenRocketCore.initialize(). Always initialize the core module before accessing any services.
ClassNotFoundException or NoClassDefFoundError
Not all required dependencies are on the classpath. The core module depends on Google Guice and several other libraries. Ensure your build tool resolves transitive dependencies correctly.
Database loading issues
Component preset and motor database files must be accessible on the classpath. During development, use the openrocket.bypass.presets and openrocket.bypass.motors system properties to skip database loading entirely.