Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » MOFScript » call a java method from a transformation
call a java method from a transformation [message #1092929] Fri, 23 August 2013 06:45 Go to next message
beaperez Mising name is currently offline beaperez Mising name
Messages: 81
Registered: July 2009
Member
Hello!
I am trying to invoke a java method from a transformation.

The java class (plugin.JavaClass) is in the directory:

JavaProject/src/plugin/JavaClass.java

with the simple code:

package plugin;

class JavaClass{
public String example(){
return "Hello";
}
}


and the MOFScript transformation in:

JavaProject/src/plugin/transformations/transformation.m2t

I am using the code:

hello= java ("plugin.JavaClass", "example", null, "C:/Program Files/Java/jre7/")

But I get an "Java Class not found" error.

Does anybody know where is the problem?

Thank you very much in advance
Bea
Re: call a java method from a transformation [message #1099813 is a reply to message #1092929] Mon, 02 September 2013 04:45 Go to previous message
beaperez Mising name is currently offline beaperez Mising name
Messages: 81
Registered: July 2009
Member
The problem was the classpath...I have used the path to the "bin" folder of the used Eclipse project (for example C:/eclipse/workspace/MyProject/bin/, and it works.
Previous Topic:call a java method from a transformation
Next Topic:Input parameters in a transformation
Goto Forum:
  


Current Time: Mon Sep 01 07:38:23 EDT 2014

Powered by FUDForum. Page generated in 0.02533 seconds