好的,所以我正在尝试在我的 jar 中执行一个类
我将如何让它在 jar 中运行类?如果这甚至可能的话。
button1.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent e) {
try {
Runtime.getRuntime().exec("java -Dfile.encoding=Cp1252 -classpath MiddleEarth728/src/bin;MiddleEarth728/src/lib/libs.jar;MiddleEarth728/src/lib/graphics.jar; MiddleEarth728.src.Loader");
dispose();
} catch (Exception err) {
err.printStackTrace();
}
}
});
button2.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent e) {
try {
Runtime.getRuntime().exec("Java -Xmx500m client 0 0 highmem members 0");
dispose();
} catch (Exception err) {
err.printStackTrace();
}
}
});