|
Yes, calling Java from RPG, no problem! I have done this to access the JAVA mail APIs, to send formatted HTML emails directly from RPG. Much simpler than using the OS400 sendmail API's. If you understand running procedures in RPG, you will have no problem calling Java from RPG, one you figure out 1. Setting up your classpath 2. Sending output to Stdout/Stderr so that you can view errors 3. Creating objects such as String, so that you can pass a string object to the class you want to call Once you figure these out, which is a bit of a learning process, its actually pretty straight-forward. First call seems to be slow, presumably creating the JVM, after that its pretty nippy Cheers Colin.W -----Original Message----- From: McCallion, Martin [mailto:martin.mccallion@xxxxxxxxx] Sent: 04 November 2003 14:32 To: 'Midrange Systems Technical Discussion' Subject: RE: what is Java bytecodes? was a contentious ILE vs CLI debate. > >> Basically, the question is, what does Java bytecodes > provide in terms of > the > >> inter language use of classes? That is, can the Java > bytecodes generated > by > >> the compiling of code in one language be referenced at the > source code > level > >> by a programmer in another language. Well, you can call Java classes from RPG: there is a source-level interface. > What I am interested in is mixing Java and RPG without the need of a > cumbersome interface barrier. I haven't done it, (calling Java from RPG) but from what I've seen of it, the interface appears to be just an extension of the RPG procedure interface (PR and PI specs, basically). > So what prevents the RPG compiler from translating RPG to > Java ByteCodes? Probably just that IBM hasn't seen a cost/benefit-justifiable business reason for doing so; but perhaps Hans could comment on this? > Esp if VisualAge RPG possibly does. The thinking being that > if RPG can > translate to ByteCodes, then the programmer can also natively > reference Java > classes contained in the Java ByteCode stream emitted by the > compiling of > Java code. Well, as I said above, the (RPG) programmer _can_ reference Java classes; the fact that what you call by doing so is bytecode rather than 'conventional' OS/400 objects is neither here nor there, really. Even if RPG could compile to bytecode natively, there would still have to be a syntax for calling Java classes. And it would probably be the syntax we already have. Cheers, Martin. -- Martin McCallion Senior Technical Consultant Misys Wholesale Banking Systems 1 St George's Road, London, SW19 4DR, UK T +44 (0)20 8486 1951 F +44 (0) 20 8947 3373 martin.mccallion@xxxxxxxxx www.misys.com This email and any attachments have been scanned for known viruses using multiple scanners. We believe that this email and any attachments are virus free, however the recipient must take full responsibility for virus checking. This email message is intended for the named recipient only. It may be privileged and/or confidential. If you are not the intended named recipient of this email then you should not copy it or use it for any purpose, nor disclose its contents to any other person. You should contact the Misys Banking and Securities Division as shown below so that we can take appropriate action at no cost to yourself. Misys Banking and Securities Division, 1 St George's Road, Wimbledon, London, SW19 4DR, England. Email: banking.postmaster@xxxxxxxxxx Tel: +44 (0) 20 8879 1188 Fax: +44 (0) 20 8947 3373 _______________________________________________ This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list To post a message email: MIDRANGE-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options, visit: http://lists.midrange.com/mailman/listinfo/midrange-l or email: MIDRANGE-L-request@xxxxxxxxxxxx Before posting, please take a moment to review the archives at http://archive.midrange.com/midrange-l. For the latest on Bertram Books products and services and for up-to-the-minute book news visit www.bertrams.com This e-mail and any attachments may contain information that is confidential and privileged and is solely for the use of the intended recipient. If you are not the intended recipient please notify the sender and delete this e-mail and any attachments immediately
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.