java如何打开程序旁边的快捷方式?(java how do you open a shortcut next to the program?)

嗨我试图从我的jar文件旁边的文件夹运行/打开一个快捷方式。我似乎无法让它工作,因为它一直说

该系统找不到指定的文件

你能指出我做错了什么吗?

JButton btnInstall = new JButton("Install/Run");
btnInstall.setEnabled(false);
btnInstall.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
ChangePath(ProgramAdder.programs.get(count).ProgramPath.toString());
System.out.print(ProgramAdder.programs.get(count).ProgramPath.toString());
}
});
btnInstall.setBounds(173, 226, 116, 45);
frame.getContentPane().add(btnInstall);
public void ChangePath(String Path){
try {
Process process= Runtime.getRuntime().exec(Path);
} catch (IOException e) {
e.printStackTrace();
}
}
。
package Logic;
import java.util.ArrayList;
import java.util.List;
public class ProgramAdder {
public static List programs = new ArrayList( );
public static void ProgramList(){
ProgramAdder.addProgram("HD Sentinel","/Shortcuts In Order/1 - HDSentinel.lnk");
ProgramAdder.addProgram("Defraggler","/Shortcuts In Order/2 - Defraggler.lnk");
ProgramAdder.addProgram("CC Cleaner","/Shortcuts In Order/3 - CCCLEANER.lnk");
ProgramAdder.addProgram("Hit Man Pro 64Bit","/Shortcuts In Order/4 - HitManPro 32bit.lnk");
ProgramAdder.addProgram("Hit Man Pro 32Bit","/Shortcuts In Order/4 - HitManPro 64bit.lnk");
ProgramAdder.addProgram("Super Anti Spyware","/Shortcuts In Order/5 - SuperAntiSpyware.lnk");
ProgramAdder.addProgram("Malware Bytes","/Shortcuts In Order/6 - MalwareBytes.lnk");
}
public static void addProgram(String ProgramName,String ProgramPath){
Programs p = new Programs();
p.ProgramName = ProgramName;
p.ProgramPath = ProgramPath;
programs.add(p);
}
}

我尝试在main中运行此功能,但我仍然得到相同的错误

package Logic;
import java.io.IOException;
public class OpenTets {
public static void OpenProgram(){
try {
Process process= Runtime.getRuntime().exec("/Shortcuts In Order/1 - HDSentinel.lnk");
} catch (IOException e) {
e.printStackTrace();
}
}
}
Hi im trying to run/open a shortcut from the folder next to my jar file.I can't seem to get it to work it as it keeps saying
The system cannot find the file specified
Can you please point out to me what am doing wrong?
JButton btnInstall = new JButton("Install/Run");
btnInstall.setEnabled(false);
btnInstall.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
ChangePath(ProgramAdder.programs.get(count).ProgramPath.toString());
System.out.print(ProgramAdder.programs.get(count).ProgramPath.toString());
}
});
btnInstall.setBounds(173, 226, 116, 45);
frame.getContentPane().add(btnInstall);
public void ChangePath(String Path){
try {
Process process= Runtime.getRuntime().exec(Path);
} catch (IOException e) {
e.printStackTrace();
}
}
.
package Logic;
import java.util.ArrayList;
import java.util.List;
public class ProgramAdder {
public static List programs = new ArrayList( );
public static void ProgramList(){
ProgramAdder.addProgram("HD Sentinel","/Shortcuts In Order/1 - HDSentinel.lnk");
ProgramAdder.addProgram("Defraggler","/Shortcuts In Order/2 - Defraggler.lnk");
ProgramAdder.addProgram("CC Cleaner","/Shortcuts In Order/3 - CCCLEANER.lnk");
ProgramAdder.addProgram("Hit Man Pro 64Bit","/Shortcuts In Order/4 - HitManPro 32bit.lnk");
ProgramAdder.addProgram("Hit Man Pro 32Bit","/Shortcuts In Order/4 - HitManPro 64bit.lnk");
ProgramAdder.addProgram("Super Anti Spyware","/Shortcuts In Order/5 - SuperAntiSpyware.lnk");
ProgramAdder.addProgram("Malware Bytes","/Shortcuts In Order/6 - MalwareBytes.lnk");
}
public static void addProgram(String ProgramName,String ProgramPath){
Programs p = new Programs();
p.ProgramName = ProgramName;
p.ProgramPath = ProgramPath;
programs.add(p);
}
}
I tried running this function in main but again i still get the same error
package Logic;
import java.io.IOException;
public class OpenTets {
public static void OpenProgram(){
try {
Process process= Runtime.getRuntime().exec("/Shortcuts In Order/1 - HDSentinel.lnk");
} catch (IOException e) {
e.printStackTrace();
}
}
}