I'm trying to run a new instance of my java application using the exec() function, that's my code:
String javaPath = System.getProperty("java.home");
try {
String path = System.getProperty("java.home") + File.separator + "bin" + File.separator + "javaw";
String command = path + " -cp " + Minecraft.getInstance().gameDirectory.getAbsolutePath() + "\\versions\\myversion\\myversion.jar net.minecraft.client.main.Main " + Main.arguments.stream().map(Object::toString).collect(Collectors.joining(" "));
LOGGER.info(command);
Runtime.getRuntime().exec(command);
} catch (IOException e) {
e.printStackTrace();
}```
I'm logging it, and it looks right:
```C:\Users\franc\AppData\Local\Packages\Microsoft.4297127D64EC6_8wekyb3d8bbwe\LocalCache\Local\runtime\java-runtime-gamma\windows-x64\java-runtime-gamma\bin\javaw -cp C:\Users\franc\AppData\Roaming\.minecraft\versions\myversion\myversion.jar net.minecraft.client.main.Main --username ZainJx --version myversion --gameDir C:\Users\franc\AppData\Roaming\.minecraft --assetsDir C:\Users\franc\AppData\Roaming\.minecraft\assets --assetIndex 3 --uuid 7ef0UUID7aafc22101f1 --accessToken alsdkjfhaTHELONGACCESSTOKENkasdjhff --clientId NDg1NzA2NjTHECLIENTIDMxNmNj --xuid 2UID543 --userType msa --versionType release```
i've also tried substituting `path` with `"java"` or `System.getProperty("java.home") + File.separator + "bin" + File.separator + "javaw.exe"`
The problem is that nothing happens. literally, nothing, no errors or anything, and the application doesn't run.
I'm open to any other method if this one won't work.