How to launch a jar file with c++ exe? -


i have file .jar , want launch c++ exe.

i have written inside file exe code:

#include <windows.h> #include <iostream>  using namespace std;  int main() {     system("cd e:\\test\\test 1.0");    system("java -jar test.jar");  } 

but gives me output: "unable access jarfile test.jar"

how solve problem?

each call "system" independant former one, second call system has not working directory think has, default one. either need regarding execution of jar in 1 system call or, better , easier, provide absolute path jar in system call.

invokes command processor execute command.

system

there's no sentence command processor persistant different calls system or 1 , same used, state preserved etc. that's simypl not case, 1 call of times directly refers 1 execution of cmd.exe on windows or default shell on linux or whatever.


Comments

Popular posts from this blog

powershell Start-Process exit code -1073741502 when used with Credential from a windows service environment -

twig - Using Twigbridge in a Laravel 5.1 Package -

c# - LINQ join Entities from HashSet's, Join vs Dictionary vs HashSet performance -