CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   CD-adapco (http://www.cfd-online.com/Forums/cd-adapco/)
-   -   STAR-CCM+ Java class (http://www.cfd-online.com/Forums/cd-adapco/56727-star-ccm-java-class.html)

Claudene July 17, 2008 04:37

STAR-CCM+ Java class
 
I have design a Java class to be called from a STAR-CCM+ macro. But I've got the error: ...17: cannot find symbol symbol : class javatest

I set the variable CLASSPATH before starting starccm+ but it didn't solve the problem. I have also tried to set from menubar Tools->Options->"STAR-CCM+, Environment", „User macro classpath" but it also not works.

Here you can find my steps: change directory: cd /home/cre/StarCCM compiling Java program (/home/cre/StarCCM/testjava.java) javac testjava.java "d /home/cre/StarCCM I'm using Bash, so: export CLASSPATH=/home/cre/StarCCM starting STAR-CCM+: starccm+ Start the server connection and run the starccm+ macro. The error above is printed out.

The javatest.java: public class javatest{ public javatest(){} public void print(){

System.out.println(" # Class javatest called");} }

STARCCM+ macro: ... public void execute() { javatest myobj = new javatest(); myobj.print(); ...

I'll appreciate any kind of suggestion. Thanks in advance.


Claudene July 17, 2008 05:49

Re: STAR-CCM+ Java class
 
Solved!! I save the STARCCM+ macro and my javatest.java code saved on the directory

/home/cre/StarCCM/javatest

both java code has now in the first line

package javatest;

the macro saved from STARCCM+ has the line 'package macro;', I took it out.

that's it!!!



All times are GMT -4. The time now is 22:00.