× 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 y'all



We've discussed recently how the JVM does not recognize changes to things like CLASSPATH environment variable once it is started.



I just saw something about dynamically loading classes - and wondered if this is possible in RPG. It uses the ClassLoader class, and there don't seem to be a lot of steps to it - here's an example in Java -



public class MainClass {

  public static void main(String[] args){

    ClassLoader classLoader = MainClass.class.getClassLoader();

    try {
        Class aClass = classLoader.loadClass("com.jenkov.MyClass");
        System.out.println("aClass.getName() = " + aClass.getName());
    } catch (ClassNotFoundException e) {
        e.printStackTrace();
    }

}


I honestly don't know yet how to translate this to RPG object data types and Java prototypes, if someone has a summary like the one Barbara Morris prepared for C/C++ prototypes, that'd be very cool.



It seems this would get us around having either to sign off or start a batch job with CPYENVVAR(*YES), probably.



Or is it possible to end a JVM in my job?



Ah, questions!! Questions!!



Vern



As an Amazon Associate we earn from qualifying purchases.

This thread ...


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.