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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T16:17:28+00:00 2026-06-10T16:17:28+00:00

Currently I’m trying to make my own front-end to GDB. Everything thus far is

  • 0

Currently I’m trying to make my own front-end to GDB. Everything thus far is going swimmingly, except one part; piping input to the process, once it’s been open. I’ll include an example from my code below:

    private JButton run = new JButton("Run");
    JToolBar vertical = new JToolBar(JToolBar.VERTICAL);
    vertical.add(run);
    add(vertical, BorderLayout.WEST);

    run.addActionListener(new ActionListner()
    {
        public void actionPerformed(ActionEvent arg0)
        {
            Process proc;
            proc = Runtime.getRuntime().exec("gdb");
            proc = Runtime.getRuntime().exec("r");
        }
    }

This would allow me to run the command ‘gdb’ and pipe all of it’s output to my TextArea, but after that, the process closes and I can’t run anymore commands such as ‘r’ to the same process, instead it opens another one and tries to execute the command ‘r’ on it’s own; so is there any way for me to execute these in the same process? Also, because this will be a GUI, I’ll need to have multiple buttons be able to interact with the same process, i.e. the button ‘Run’ needs to be able to execute ‘r’, while the button ‘Breakpoint’ needs to execute ‘b’ to the same process, is this possible?

TL;DR: Need to run multiple system commands from the same process in Java through the use of a GUI, is it possible?

  • 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-06-10T16:17:30+00:00Added an answer on June 10, 2026 at 4:17 pm
    final PrintWriter out = new PrintWriter(proc.getOutputStream());
    out.println("r");
    

    They aren’t separate processes, they’re input to gdb. 🙂

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

Sidebar

Related Questions

Currently everything is working golden except for the fact that a user could manually
Currently I am trying to make my app available for iOS4, to increase the
currently I am trying to make it so that I can get access to
Currently I'm starting a new Activity and calling finish on a current one. Is
Currently I am trying to use a bunch of custom perl modules, test.pm as
Currently I have made a flash/as3 Snake game which I want to somehow make
Currently using Oracle/BEA/Plumtree ALUI Portal 6.1, and am trying to display a client's IP
currently I am trying to replace a simple HTML element to alert the user
Currently I have two projects that are separate from one another. The first is
Currently when I make a model it goes straight to the collection and saves

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.