I've found it's simplest to live with setting the classpath as a system
environment variable and add to it when necessary.
Batch mode apps could benefit from jars in a specific current directory.
Peter
-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Bradley V. Stone
Sent: Thursday, 12 June 2008 10:03 a.m.
To: RPG400-L@xxxxxxxxxxxx
Subject: RPG, Java and Classpath practices
I am looking for ideas on the simplest and hopefully best practice for
using Java in an RPG program.
Let's assume I have an application I want to send to my clients. This
application is mostly RPG, but uses a couple Java classes contained in a
coule JAR files.
I install the JAR files in the IFS.
Now, when running my application, I have to worry about:
1. If the classpath is set right
2. If the JVM is already running, meaning I can't change the classpath
even if I wanted to
The issue here is, if IBM wanted us to implement Java in our
applications, I would hope there would be some way to use a classpath
like a library list.
In other words, add to it, change it, remove from it, etc. All on the
fly without having to worry if someone else wrote an application using
Java that was run before in this job.
So, looking for ideas on handling this. In a nutshell, you have a
standalone app that uses Java inside of RPG and you want to ensure the
classpath is set properly when your application runs, no matter what
else they are running or if the JVM is already running for that job.
I have a feeling the answer to the question won't be simple from what
I've read, but maybe there's something someone has figured out. I've
talked with Aaron Bartell about this, and using data queues came up with
my own Java handler job running to process things, but that seems like a
lot more work than I want to do.
Thanks a million.
Bradley V. Stone
BVSTools - www.bvstools.com
eRPG SDK - www.erpgsdk.com
--
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.
#####################################################################################
This correspondence is for the named person's use only. It may contain confidential or legally privileged information, or both. No confidentiality or privilege is waived or lost by any mistransmission. If you receive this correspondence in error, please immediately delete it from your system and notify the sender. You must not disclose, copy or rely on any part of this correspondence if you are not the intended recipient. Any views expressed in this message are those of the individual sender, except where the sender expressly, and with authority, states them to be the views of Veda Advantage. If you need assistance, please contact Veda Advantage on either :- Australia 133124 or New Zealand +64 9 367 6200
As an Amazon Associate we earn from qualifying purchases.