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

twig - Using Twigbridge in a Laravel 5.1 Package -

jdbc - Not able to establish database connection in eclipse -

Kivy: Swiping (Carousel & ScreenManager) -