java - add external jar to classpath -
i have added external jar file classpath , application don't use class in ,any idea , code:
code :
string java = system.getproperty("java.home") + "/bin/java"; string classpath=system.getproperty("java.class.path"); string mainclasspath=system.getproperty("sun.java.command"); string file = "c:\path file \file.jar"; final stringbuffer command = new stringbuffer("\"" + java + "\" "); command.append("-cp \""+""+classpath+";"+file+"\" "+ mainclasspath); runtime.getruntime().addshutdownhook(new thread() { @override public void run() { try { runtime.getruntime().exec(command.tostring()); } catch (ioexception e) { e.printstacktrace(); } } }); system.exit(0);
Comments
Post a Comment