|
[Sponsors] |
December 5, 2011, 17:57 |
Macro to access java files in sub-directory
|
#1 |
New Member
Andrew Braum
Join Date: Dec 2011
Location: San Francisco
Posts: 2
Rep Power: 0 |
Hey Folks,
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: import macro.MySubDirectory.*; And likewise put the correct package header in the java file in the sub-directory: package macro.MySubDirectory; 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? |
|
January 2, 2012, 21:12 |
|
#2 |
Senior Member
Join Date: Oct 2009
Location: Germany
Posts: 636
Rep Power: 22 |
Create a .jar file (or multiple) containing your helper classes, put them somewhere and enter this path as user macro classpath (Tools -> Options)
|
|
January 24, 2012, 15:25 |
|
#3 |
New Member
Andrew Braum
Join Date: Dec 2011
Location: San Francisco
Posts: 2
Rep Power: 0 |
Thanks Abdul! I got it to work once I pointed STAR to a compiled .JAR file. Cheers!
|
|
July 11, 2012, 03:46 |
Thank you
|
#4 |
New Member
SP
Join Date: Jul 2012
Posts: 4
Rep Power: 14 |
Thank you very much.... I was run into the same problem, after seeing this post issue has been resolved.
|
|
Tags |
macro, multiple java |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Release of a Wave Generation and Absorption Toolbox for OF | ngj | OpenFOAM Announcements from Other Sources | 65 | September 4, 2022 15:01 |
UDF Data Access Macro | Woo Meng Wai | FLUENT | 0 | November 6, 2007 21:23 |
Header files | shuo | OpenFOAM Running, Solving & CFD | 1 | September 10, 2006 04:38 |
Results saving in CFD | hawk | Main CFD Forum | 16 | July 21, 2005 21:51 |
Macro to access mean variables | Dragos | FLUENT | 2 | February 2, 2005 12:30 |