× 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.



Hi Ali,

<snip>
I am using JNI api to start JVM from RPG (Prior to this I set classpath with ADDENVVAR VAR(CLASSPATH)), then trying to change the java classpath via CHGENVVAR VAR(CLASSPATH) command. But it appears that JVM is not picking up the new classpath. Is what I am
trying to do possible? Can I change JVM classpath on the fly ?
</snip>

I can't imagine that you would really want to do this.

Firstly - your JVM is running in another job so even if you set the classpath in YOUR job you'd need to find a way to export it to the job running the JVM. The export is implicit during JVM startup, but any further calls simply attaches you to the currently active JVM.

Secondly (and most important) - you already have classes loaded - you'll have objects instantiated from these, and you'll have static members (variables) set with current values. Even if you could change the classpath on the fly, I would advise against it.

If you're trying to load different classes on the fly then try using a custom class loader or other techniques (such as a factory class or using properties files) - changing the classpath seems a rather brutal way to solve problems.

Could you give us an idea of what you're trying to do?

Cheers

Larry Ducie



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.