|
I haven't tried this but it seems to be complaining about not finding java.lang.System.out Do you need a CLASS qualifier on the EXTPROC that points to the class? e.g CLASS(*JAVA : 'java.lang.System.out'). You think the Java system files would already be referenced. Its a WAG. Pete Helgren Value Added Software,Inc. -----Original Message----- From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx]On Behalf Of Bramley, Stu Sent: Thursday, March 04, 2004 3:43 AM To: 'rpg400-l@xxxxxxxxxxxx' Subject: Defining System.out.println in RPG I'm trying to put together some 'Hello World' code that will call the Java method System.out.println(String) from RPG - however I'm struggling to get this defined correctly in the RPG.. I have tried the following : * Define the Java String Object D StringObj S O CLASS(*JAVA : 'java.lang.String') * Procedure to create String object D newString PR O EXTPROC(*JAVA:'java.lang.String': D *CONSTRUCTOR) D CLASS(*JAVA:'java.lang.String') D charParm 100A CONST VARYING D println PR EXTPROC(*JAVA : D 'java.lang.System.out': D 'println') D STATIC D inString O CLASS(*JAVA : 'java.lang.String') C EVAL StringObj = newString('Hello World') C CALLP println(StringObj) C EVAL *INLR = *ON C RETURN This causes the RPG to fall over - the error is "java.lang.NoClassDefFoundError: java/lang/System/out" when calling method "println" with signature "(Ljava.lang.String;)V" in class "java.lang.System.out"." This indicates to me that the definition of println is wrong - it is looking for a Java Class called Java.lang.System.out, but the Class is java.lang.System - which has a public static final PrintStream object data member. That seems a fair enough error... but I can't determine from any of the manuals how to correctly define the call to the 'println' method on the public static final java.io.PrintStream out member of the System class... I don't think that I should need an object reference to call a static method - but I can't find a syntax that will let me define it... does anyone know how to do this? Cheers Stu Stuart Bramley Senior Technical Developer Skandia Life::GroupIT Southampton t: 023 80 72 64 29 e: stu.bramley@xxxxxxxxxxxxx If you are not the intended recipient, please notify the sender by return email and then delete the message from your computer. The Skandia UK Group reserves the right to monitor e-mail communications through its networks. No contract may be concluded on behalf of the Skandia UK Group by email. Skandia Life Assurance (Holdings) Limited Skandia Life Assurance Company Limited Skandia MultiFUNDS Limited, Skandia Investment Management Limited. Registered Nos: 1606702, 1363932, 1680071, 4227837, England Registered Office: Skandia House, Portland Terrace, Southampton SO14 7EJ, United Kingdom Royal Skandia Life Assurance Limited Registered No : 24916 Isle of Man Registered Office: Skandia House, King Edward Road, Onchan, Isle of Man IM99 1NU, British Isles Skandia Life Assurance Company Limited, Skandia MultiFUNDS Limited, Skandia Investment Management Limited and Royal Skandia Life Assurance Limited are authorised and regulated by the Financial Services Authority for UK investment business. Internet: www.skandia.co.uk _______________________________________________ This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list To post a message email: RPG400-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options, visit: http://lists.midrange.com/mailman/listinfo/rpg400-l or email: RPG400-L-request@xxxxxxxxxxxx Before posting, please take a moment to review the archives at http://archive.midrange.com/rpg400-l.
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 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.