|
2
|
|
3
|
Go to the Libraries tab and click Add External JARs. Add the JAR-file com.comsol.api_1.0.0.jar from the plugins directory under the COMSOL Multiphysics installation directory; for example
|
|
4
|
Click Finish.
|
|
5
|
Right-click the src folder in your Eclipse project and select New > Package. Enter demo as the package name and click Finish.
|
|
6
|
Right-click the demo package in your Eclipse project and select New > Class. Enter Hello as the class name.
|
|
7
|
|
8
|
In the editor window for the Hello class, add the following method and save the file:
|
|
9
|
Right-click the JavaLibDemo project and select Export > Java > JAR file. Select the export destination JAR-file and click Finish.
|
|
10
|
Start COMSOL Multiphysics and create a Blank Model.
|
|
11
|
In the Application Builder, under the application tree, right-click Libraries and select External Java Library. In the Settings window, click Browse and select the JAR-file previously exported from Eclipse®.
|
|
14
|
Click Test Application and click the button in the application to verify that the alert method is invoked.
|