Hep files can invoke a Java plugin that runs in process, or alternatively they can invoke an external Java application. This extract from the SysML.hep shows an example of how a helper file can load a Java plugin
Here's an example of the results. In this instance the Java extension is running as a plugin. This means that it's running in the JRE loaded into the Rhapsody process.
This Create Use Case package structure command is an example from a profile that I wrote called the ExecutableMBSEProfile (which is one of the optional profiles in my open source SysMLHelper project). It adds menus to accelerate an MBSE method based on use case analysis to define system requirements