Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
QProcess not starting the Java Application
Sebastian last edited by
I am trying to start the java application from QProcess. it is starting the application but only in task manager i can see that application. basicly is is not showing but running.
This is the code
QString originalPWD = QDir::currentPath(); QProcess *processStart = new QProcess(); processStart->setWorkingDirectory(getGpsClientExePath()); QString filePath = processStart->workingDirectory() + QDir::separator() + "gps.start.exe"; QDir::setCurrent(processStart->workingDirectory()); bool started = processStart->startDetached(filePath);
filepath is correct.if i double click on .exe then its starting the application also.So i dont understand why QProcess unable to start the application or show .Any lead will be appreciated.
Pablo J. Rogina last edited by
You're saying "gps.start.exe" is a Java application?
If so, could it be possible that "java" command is not available in path to your QProcess...?
Maybe you may want to look at QProcessEnvironment class to be sure the environment for QProcess is the right one you need
Buckwheat last edited by
Try using QDir directly instead using QString.
QString filePath= QDir::currentPath ().absoluteFilePath ("gps.start.exe");
This will ensure your path is properly formed.
If your gps.start.exe does not exist in that location and if your environment has a path set, then just use the name and leave off the path.
You can also just use the static method QProcess::startDetached (...); (no sense wasting memory when you can use a static method)
Sebastian last edited by aha_1980
Thanks All Guys,
My code was correct to start the application.The Problem was from java side code. So I Marked it as resolve.