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 7038339
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T01:39:26+00:00 2026-05-28T01:39:26+00:00

I have one main application which launch two other process’s, i just need to

  • 0

I have one main application which launch two other process’s, i just need to launch them as an independent process. like running them-self without using or sharing my main application launcher process memory or cpu.

But when i launch it like this TWO other process do not get executed (well they create TWO new process but not fictional), unless i kill the main process. My plan is to execute it under windows just like THREE command prompt where it execute THREE application.

How do i resolve it so that THREE execution run completely alone?

/*This is Process 1 itself*/
try {

  if (myStock.getOs().equals("Linux")) 
  {
    Runtime.getRuntime().exec("java -cp /var/dist/test.jar main.main");        
    Runtime.getRuntime().exec("java -cp /var/dist/test.jar www.webserver_starter");

  } else {

    /*Windows 7 only*/
    String WindowsTemp = System.getenv("MY") + "\\";
    /*This is Process 2*/
    Runtime.getRuntime().exec("java -cp " + WindowsTemp + "dist\\test.jar main.main");        
    /*This is Process 3*/
    Runtime.getRuntime().exec(
        "java -cp " + WindowsTemp + "dist\\test.jar www.webserver_starter");
  }

} catch(Exception e) {
  System.out.println(e);
}
  • 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-28T01:39:27+00:00Added an answer on May 28, 2026 at 1:39 am

    For Windows use cmd /c start ... where '...' is the command you would like to invoke.

    Runtime.getRuntime().exec("cmd /c start java -cp /var/dist/test.jar main.main")
    

    For Linux add & at the end of command to start a daemon process.

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

Sidebar

Related Questions

I have a small workspace with 3 projects. One main (Swing) application, two other
I have WPF Application where I have One main form and other user controls
I have an application that has two threads. The first one (the main thread)
we have one main application, which executes up to 5 different exes. These exes
I have a django application which has one main table/model which references various 'lookup'
I have an application which resides in menu bar, pretty much like this one
I have a Core Data based application which is built around one main entity.
I have created one application in which Main Form Calls Sub Form on FormShow
I'm working on Android application which have two different tabhost : Main and Child.
With a distributed application, where you have lots of clients and one main server,

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.