Solved

Class in a registered Java component not found

Hi,

Following the instructions on Component Library example for JEE edition I created a simple Java class (named MNBUtils) having an add method which returns the sum of its two parameters.

befdc98b6735750c292662c100137e27

Then I registered the jar file containing this class using the Tools/Components Add feature of the Studio.

f6e18aa7285a655679360e77ca135e0b

For a service task I created the following onExit Expression:

var utils = new MNBUtils();

CHelper.trace("JavaTest", utils.add(3,4)) ;

When I save the expression, I get an error message "MNBUtils variable has not been declared", but I bypass this message as the instruction mentioned above writes:

1bef8615c5d273ff744ac474dca6acff

When I run the process, I get this error:

faae6808cc281a8318c2688338f30b40

What's wrong and how to fix it?

Thanks,

Laszlo

Best Answer
photo

Okay, problem solved.

The used JDK version was wrong in the Java component - I used 1.8 instead of 1.7. After changing to 1.7, all errors are gone and the code works fine.

Comments (1)

photo
1

Okay, problem solved.

The used JDK version was wrong in the Java component - I used 1.8 instead of 1.7. After changing to 1.7, all errors are gone and the code works fine.