× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



I am trying to write a RPG program that will call a java method in a class. I 
am able to call main fine, but when i try to call fred I get a RNX0301 
"Java.lang.NoSuchMethodError: fred".  Can anyone else see what I am doing wrong?

Thanks, 

Chris


     H Thread(*SERIALIZE)
     H Dftactgrp(*NO)
     H Bnddir('QC2LE')
     d mainCall$Main   PR                  STATIC
     d                                     EXTPROC(
     d                                        *JAVA:
     d                                        'demo.MainCall':
     d                                        'main')
     d                                 O   CLASS(*JAVA:'java.lang.String')
     d                                     DIM(2)
     d                                     CONST
     d String$new      PR              O   EXTPROC(
     d                                        *JAVA:
     d                                        'java.lang.String':
     d                                        *CONSTRUCTOR)
     d                                     CLASS(
     d                                        *JAVA:
     d                                        'java.lang.String')
     d bytes                         50A   CONST VARYING
     d args            s               O   CLASS(
     d                                        *JAVA:
     d                                        'java.lang.String')
     d                                     DIM(2)
      ***************************************************************
     d mainCall$fred   PR                  STATIC
     d                                     EXTPROC(
     d                                        *JAVA:
     d                                        'demo.MainCall':
     d                                        'fred')

      ***************************************************************
     D System          PR            10I 0 ExtProc('system')
     D  CmdText                        *   Value Options(*String)
      ***************************************************************
      /free
       args(1) = String$new('Test String 1');
       args(2) = String$new('Test String 2');
       MainCall$main(args);
       system('dlyjob (2)');

       MainCall$fred();
       system('dlyjob (2)');

       *inlr = *on; 
**********************************************************************************
package demo;

public class MainCall {
        public static void main(String[] args) {
                for (int i = 0; i < args.length; i++) {
                        System.out.println("Parameter " + i + " " + args[i]);
                }
        }

        public static void fred() {
                System.out.println("Fred");
        }

}
**********************************************************************************
-------------------------------------------------

This email transmission and any documents, files or previous

email messages attached to it may contain information that is

confidential or legally privileged. If you are not the intended

recipient, you are hereby notified that any disclosure, copying,

printing, distributing or use of this transmission is strictly

prohibited. If you have received this transmission in error,

please immediately notify the sender by telephone or return

email and delete the original transmission and its attachments

without reading or saving in any manner.



The Evangelical Lutheran Good Samaritan Society.

---------------------------------------------------------

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.