i want to add an external jar to my application path , this is my code but it dosn't work.
code:
final String javaBin = System.getProperty("java.home") + File.separator + "bin" + File.separator + "java";
File Jar = null;
try {
Jar = new File(MyApp.class.getProtectionDomain().getCodeSource().getLocation().toURI());
} catch (URISyntaxException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
final ArrayList<String> command = new ArrayList<String>();
command.add(javaBin);
command.add("-classpath");
command.add("\""+"C:\\path to file\\file.jar"+"\""+" ");
command.add(Jar.getPath());
Restart();