Hi
I'm using NetBeans + GCC in Linux and also NetBeans + MinGW in Windows.

I need to run an OS Command e.g.: java -jar myjar.jar I prefer not to have the terminal/cmd window. It works fine in Linux, but in windows, it ends up in opening a cmd window anyway.

I tried javaw too.

Any help would be appreciated.

system("java -jar myjar.jar");

I have used this command, as I mentioned it works fine in Linux, but in Windows it appears an annoying command window. (Terminal window)

why not append system exit after that

system("java -jar myjar.jar");
exit(0);

why not append system exit after that

system("java -jar myjar.jar");
exit(0);

I doesn't work!!!

Doesn't work!

I doesn't work!!!

what error does it throw?
Are you implementing this on Linux or windows?

I doesn't work!!!

Doesn't work!

Scream harder, maybe it'll start working!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.