The COMSOL API and Compiling Java Code
The COMSOL API is a Java-based programming interface for COMSOL Multiphysics. The COMSOL API can be used for a variety of purposes, such as running a model file for Java from the COMSOL Desktop or using the available batch command.
To run a model file for Java from the COMSOL Desktop, compile it using the comsol compile command. This command is called comsolcompile on Windows® and comsol compile on other platforms. The same commands can also compile model files into runnable apps with the COMSOL Compiler. The compilation gets you a model class file corresponding to the model file for Java. Launch the model class file by choosing Open in the File menu and then selecting a Model Class File under File name.
To create an application using the COMSOL API, you need to develop a text-based or UI-based interface to the functionality and compile it using the COMSOL compile command. The application can be run in standalone mode that links your Java® application directly to the COMSOL code (as a single process), but it requires a license for COMSOL Multiphysics. You can also choose to run the application in client–server mode by connecting to a COMSOL Multiphysics server or COMSOL Server.
To see options for compiling Java files, see The COMSOL Commands for your platform. For more comprehensive information about the COMSOL API, see the COMSOL Programming Reference Manual and the Application Programming Guide.