H dftactgrp(*no) H thread(*serialize) H bnddir('JNIUTIL') /copy jniutil_p D SystemClass c 'java.lang.System' D StringClass c 'java.lang.String' D getProperty pr o extproc(*java D : SystemClass D : 'getProperty') D class(*java : StringClass) D static D prop o const class(*java : StringClass) D getBytes pr 65535a varying D extproc(*java D : StringClass D : 'getBytes') D newString pr o extproc(*java D : StringClass D : *constructor) D val 65535a const varying D str s o class(*java : stringClass) D result s 65535a varying D dsp s 52 D prop s 40a varying inz('java.version') D p s 10i 0 D helpmsg s 52a D env s * /free helpmsg = 'Enter "q" for the property, when you want to quit'; dsply helpmsg; if env = *NULL; env = getJniEnv(); endif; dow prop <> 'q'; prop = ' '; dsply 'Property?' ' ' prop; if prop = 'q' or prop = 'Q'; *inlr = '1'; return; elseif prop = ' ' or prop = '?'; dsply helpmsg; iter; endif; // use beginObjGroup to mark the beginning of the // code that uses Java objects, and use endObjGroup // to free all those objects beginObjGroup (env : 100); str = newString (prop); str = getProperty (str); if str = *null; result = 'That property was not found'; else; result = getBytes (str); endif; endObjGroup (env); // loop 52 bytes at a time to display the property p = 1; dow p <= %len(result); dsp = %subst(result : p); // get 52 or fewer bytes dsply dsp; p = p + 52; enddo; enddo; return;