Get an environment variable

zhaozj2021-02-16  44

method 1:

Byte [] env = new byte [1000]; try {process objprcess = objruntime.exec ("cmd / c echo% java_home); inputstream in = objprcess.getinputStream (); in.read (ENV); string ls_env = New string (env) .trim (); system.out.println ("ls_env:" ls_env);} catch (exception e) {E.PrintStackTrace ();}

Method 2:

Public class getsysproperties {public static void main (string [] argv) {system.getproperties (). list (system.out);}}

转载请注明原文地址:https://www.9cbs.com/read-21288.html

New Post(0)