Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7507987
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T22:35:44+00:00 2026-05-29T22:35:44+00:00

I have written an application which simply executes java -jar . I want the

  • 0

I have written an application which simply executes java -jar. I want the starter application to exit immediately after executing CreateProcessA.

LPSTR _cmdupdate = const_cast<char *> (cmdupdate.c_str());
STARTUPINFO info = {sizeof (info)};
ZeroMemory(&info,sizeof(info));
info.cb=sizeof(info);
PROCESS_INFORMATION processInfo;
ZeroMemory(&processInfo,sizeof(processInfo));
CreateProcessA(TEXT(java_exe.c_str()), _cmdupdate, NULL, NULL, false, 0, NULL, TEXT("bin"), &info, &processInfo);
CloseHandle(processInfo.hProcess);
CloseHandle(processInfo.hThread);
exit(0);

If I’am executing this via IDE (Netbeans 7) everything works fine: java continues running while the starter terminates.
If I’am running the same exe by double clicking on it: java starts up the jar, but the starter waits for the java process to exit.

So what’s the difference to CreateProcess when running via IDE vs. running standalone?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T22:35:47+00:00Added an answer on May 29, 2026 at 10:35 pm

    The Java interpreter is a console process. Chances are that your program is a console process too, so Java inherits and shares your console. That’s why your process seems to wait for the Java to finish. It actually does not, just the console stands there.

    When you run your program from the IDE, it probably handles the console in a special way and makes it disappear when your program finishes. Or maybe it redirects the output and hides the console in the first place.

    Solution: Use some of the flags defined here to handle the console of the new process. Try CREATE_NEW_CONSOLE or DETACHED_PROCESS or maybe CREATE_NO_WINDOW.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have written a application which runs in the background. I want to write
I have written an application in which I want to convert a .jpg image
I have written a small java application for which I need to obtain performance
I have a application written in wxPython which I want to make multilingual. Our
I have written a Java program which I package and run from a JAR
I have written a GUI application which after performing some analyses on a large
I have written a Ruby application which parses lots of data from sources in
I have written a PHP application which requires storage of millions of integers between
I am developing an application which requires to add Calendar event. I have written
I have application written in Visual Studio 2008 which I deploy with ClickOnce to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.