Results 1 to 4 of 4
Like Tree1Likes
  • 1 Post By doWhile

Thread: Help needed in Passing values to another program.

  1. #1
    Kuttappu's Avatar
    Kuttappu is offline Member
    Join Date
    Aug 2011
    Location
    Kerala, India
    Posts
    40
    Rep Power
    0

    Question Help needed in Passing values to another program.

    I am doing a launcher for a client of a game.
    When i click a button in my launcher i need to pass some values to the client through command line, only then the client works.
    Client is a ".exe" file.
    How can i pass values to client from my launcher?

  2. #2
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,315
    Blog Entries
    1
    Rep Power
    26

    Default Re: Help needed in Passing values to another program.

    Look into using a ProcessBuilder object to launch the client, and check out the API which will explain how to pass in command line parameters. Take care to swallow the process's error and output streams.

  3. #3
    doWhile is offline Moderator
    Join Date
    Jul 2010
    Location
    California
    Posts
    1,641
    Rep Power
    7

    Default Re: Help needed in Passing values to another program.

    ...and to add to Fubarable's post, some suggested reading:
    When Runtime.exec() won't - JavaWorld
    Fubarable likes this.

  4. #4
    Kuttappu's Avatar
    Kuttappu is offline Member
    Join Date
    Aug 2011
    Location
    Kerala, India
    Posts
    40
    Rep Power
    0

    Default Re: Help needed in Passing values to another program.

    I got it. This is the format i used.

    Process process = new ProcessBuilder("C:\\PathToExe\\MyExe.exe","param1" ,"param2").start();

Similar Threads

  1. Arrays and passing values to methods help please.
    By toppcon in forum New To Java
    Replies: 21
    Last Post: 07-28-2011, 06:05 AM
  2. Passing values between classes problem.
    By alin_ms in forum New To Java
    Replies: 8
    Last Post: 12-12-2008, 07:49 PM
  3. Replies: 0
    Last Post: 05-22-2008, 11:53 AM
  4. Passing the Values
    By Lagarto in forum JDBC
    Replies: 1
    Last Post: 07-16-2007, 04:03 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •