CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > Siemens > STAR-CCM+

Macro to access java files in sub-directory

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By abdul099

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   December 5, 2011, 17:57
Default 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
abraum is on a distinguished road
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?
abraum is offline   Reply With Quote

Old   January 2, 2012, 21:12
Default
  #2
Senior Member
 
Join Date: Oct 2009
Location: Germany
Posts: 636
Rep Power: 22
abdul099 is on a distinguished road
Create a .jar file (or multiple) containing your helper classes, put them somewhere and enter this path as user macro classpath (Tools -> Options)
ryancoe likes this.
abdul099 is offline   Reply With Quote

Old   January 24, 2012, 15:25
Default
  #3
New Member
 
Andrew Braum
Join Date: Dec 2011
Location: San Francisco
Posts: 2
Rep Power: 0
abraum is on a distinguished road
Thanks Abdul! I got it to work once I pointed STAR to a compiled .JAR file. Cheers!
abraum is offline   Reply With Quote

Old   July 11, 2012, 03:46
Default Thank you
  #4
New Member
 
SP
Join Date: Jul 2012
Posts: 4
Rep Power: 14
trsakthipriya is on a distinguished road
Thank you very much.... I was run into the same problem, after seeing this post issue has been resolved.
trsakthipriya is offline   Reply With Quote

Reply

Tags
macro, multiple java


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


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


All times are GMT -4. The time now is 18:47.