CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   STAR-CCM+ (https://www.cfd-online.com/Forums/star-ccm/)
-   -   StarCCM+ Command line options and Macro execution (https://www.cfd-online.com/Forums/star-ccm/108436-starccm-command-line-options-macro-execution.html)

isidp October 23, 2012 13:40

StarCCM+ Command line options and Macro execution
 
Hi to all,

I've written a Star-CCM+ Macro that uses a jar library. From the Star-CCM+ GUI it works because I've set the "User Macro classpath" (Menu Tools=>Options=>Environment).

Now, I want to run the same macro from command line. Into documentation there is a command line option "-classpath" that should overried the "User macro classpath", but it doesn't work. Obviously, I've removed the "User macro classpath" option

The command line is:
Code:

starccm+ -classpath "C:\libs" -m MyMacro.java simulation
but it gets an error window: package xyz does not exist ... cannot find symbol. It seems that it cannot find the jars and that the classpath setting from command line fails.

Thanks

sgrshukla October 23, 2012 14:30

classpath is the location of class library used for the macro. where your .jar files if located in different directory.. If you just recorded macro then just run it without providing classpath.

isidp October 24, 2012 04:29

Hi sgrshukla,

Quote:

Originally Posted by sgrshukla (Post 388162)
If you just recorded macro then just run it without providing classpath.

I've written the macro and it uses an external jar. I need the classpath to specify the jar location.

So, from GUI it works (I've added the classpath to "User macro classpath"), but it doesn't work from command line with the option "-classpath"

abdul099 October 24, 2012 13:42

Linux or Windows?

isidp October 24, 2012 13:44

Hi abdul099,

Now, I'm working on Windows operating system.

sgrshukla October 24, 2012 17:04

I think you also want to add "-batch" in command line before macro name and filename.

aparajitha January 29, 2013 03:21

Star CCM+ Unable to access JAR in Linux Envi
 
Hi All,

I wrote a mcro using some supporting JAR.

I have added the both JAR path and macro path in "User Macro ClassPath" Settings also.

But my macro is unable to find the '.JAR' i have used.

Iam using Star CCM+ 7.04 in linux environment.

Kindly help me.

Thanks,
aparajitha

isidp January 29, 2013 03:39

[SOLVED] StarCCM+ Command line options and Macro execution
 
Hi,

I'm going to describe the solution to my initial post and some tricks that I've faced. Solution is for Windows Operating System but It can be easily adapted for linux environment.

-------
It's possible to override macro libraries path (classpath) from command line only with "-batch" option otherwise you should set library path from GUI into "User Macro ClassPath" window. It's an example of command line macro execution:

Quote:

starccm+ simfile.sim -batch MyMacro.java -classpath "C:\libs"
Finally, classpath string (e.g. "C:\libs") hasn't the "\" char at the end; I've gets some errors terminating path with blackslash as last character.
----

Thanks to all.

aparajitha January 29, 2013 05:00

Hey,

It's in Linux environment..

Also, starccm+ command is giving me error: "Command not found"

Iam giving this command from path where ccm is installed.

Thanks in advance..


All times are GMT -4. The time now is 06:55.