Results 1 to 4 of 4

Thread: [SOLVED] make a java program start with arguments?

  1. #1
    Join Date
    Oct 2005
    Location
    Gainesville, FL
    Beans
    Hidden!
    Distro
    Kubuntu 9.10 Karmic Koala

    [SOLVED] make a java program start with arguments?

    I'm working on writing a server/client program and I'd like to be able to set the ip address that the client needs to connect to by passing in as an argument.
    For example:
    Code:
    RegisterClient 192.168.1.50
    As opposed to hardcoding the address in the client and having to recompile.

    Thanks,
    Griff

  2. #2
    Join Date
    Nov 2006
    Location
    Israel
    Beans
    765
    Distro
    Ubuntu 9.04 Jaunty Jackalope

    Re: make a java program start with arguments?

    Intel E6300 / MSI P4M890M / 2GB DDR2 677 / 80GB + 1TB SATA2 / GeForce 6200TC / DL DVD+-RW / Dell 24" U2410

  3. #3
    Join Date
    Aug 2006
    Location
    60°27'48"N 24°48'18"E
    Beans
    3,458

    Re: make a java program start with arguments?

    Code:
    public static void main(String[] args) {
      String myArg = args[0];
    }
    LambdaGrok. | #ubuntu-programming on FreeNode

  4. #4
    Join Date
    Oct 2005
    Location
    Gainesville, FL
    Beans
    Hidden!
    Distro
    Kubuntu 9.10 Karmic Koala

    Re: make a java program start with arguments?

    Well I thought it would be a little more difficult than that. I feel like I wasted your time!
    Thanks!
    -Griff

Bookmarks

Posting Permissions

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