On 8/26/2015 1:29 PM, Justin Taylor wrote:
I tried just like that. It gave a slightly different error though:
Java exception "java.lang.NoClassDefFoundError: com.test.SayHello" when
calling method "testIt" with signature "()V" in class
"com.test.SayHello".
Far and away, CLASSPATH is the hardest thing to get right for newcomers.
How did you add the package name?
Try extproc(*java : 'com.test.SayHello' : 'testIt')
http://www-01.ibm.com/support/knowledgecenter/ssw_ibm_i_72/rzasc/callmethown.htm
As a lifelong RPG programmer, I'm very comfortable with the notion of a
source member stored in a source PF stored in a library and being able
to qualify the lot on a CRTBNDRPG command.
The Java 'equivalent' is to use Notepad to edit one .java file and then
use javac to create the .class file. I started there and it looks like
you did too.
Normal Java development isn't like that at all. Normal Java development
requires that you store the .java file(s) in a very specifically named
hierarchy of directories. That hierarchy exactly mirrors the package
name. Using Eclipse, one would typically use the wizards to create a
package, class, and method. If you retrofitted an existing class, you
probably didn't follow the implicit rules for how to store the thing.
It seems crazy until you've done it a few times, and then it becomes
just one of those things you forget about because the IDE handles it for
you.
As an example, I have a Java class called ConvertDToFreeAction. I
created it with Eclipse (to extend RDi). It's stored in
../src/com/kc2hiz/lpexextensions/ConvertDToFreeAction.java The package
statement in the .java file is 'package com.kc2hiz.lpexextensions;'
Hope this helps, and isn't too far off topic.