Discussion Closed This discussion was created more than 6 months ago and has been closed. To start a new discussion with a link back to this one, click here.
importing and compiling multiple custom Java classes to use with COMSOL Java API code
Posted 28 mar 2023, 11:14 GMT-4 General, API, User Interface Version 6.1 2 Replies
Please login with a confirmed email address before reporting spam
Hello,
I would like to integrate custom Java classes with my COMSOL Java API code. However, I cannot find any recommendation about how to do it using the comsol compile
in the documentation.
I would like to ask for further clarification about how to do this.
Let's say I have two files, Main.java and Pair.java. The first file has the main and the COMSOL model. The second file implements a simple class Pair the works similarly to tuple.
Should I compile multiple .java files at once? Should I make a package using a directory containing classes and import them from the main file? Or should make a JAR files? How should I organise file structure and how to use comsol compile
to compile?
In the comsol compile -help
there is the classpathadd <classpath> option to provide an additional classpath. However, it's not clear how to use it. Could you provide examples of usage please?
Many thanks, Francisco