Macro to access java files in sub-directory
I am new to STAR-CCM+ as well as Java programming (I do have c++ experience). I created a macro to run a simulation which tries to reference a support class in a sub-directory. (I use the helper class to set variables such as the save location, save name, CSV export names, etc. I mainly want to compartmentalize my code for organization purposes. My hope is that future, much larger macros can be broken down into smaller files making it easier to switch on and off functionality.)
I have messed around with some simple java files and and can access metods the sub-directories by importing:
And likewise put the correct package header in the java file in the sub-directory:
STAR-CCM+ then complains that it cannot find that class in the sub-directory:
package macro.MySubDirectory does not exist
cannot find symbol
symbol: class MyHelperClass
location: class macro.MyModifiedStarMacro
Is STAR-CCM+ not capable of reading in (importing) other java classes in the same or sub-directories? If not, then is there a nice way to organize the larger macros?
Create a .jar file (or multiple) containing your helper classes, put them somewhere and enter this path as user macro classpath (Tools -> Options)
Thanks Abdul! I got it to work once I pointed STAR to a compiled .JAR file. Cheers!
Thank you very much.... I was run into the same problem, after seeing this post issue has been resolved.
|All times are GMT -4. The time now is 22:05.|