Thread: Jarring a client with parameters. [rep++ and thank]

Page 1 of 2 12 LastLast
Results 1 to 10 of 14
  1. #1 Jarring a client with parameters. [rep++ and thank] 
    Banned
    Join Date
    Sep 2011
    Posts
    177
    Thanks given
    32
    Thanks received
    13
    Rep Power
    0
    I have a Epicurus client working fine, and I can't seem to JAR it because you need parameters to run the client, any tips on how to JAR this client?
    Reply With Quote  
     

  2. #2  
    need java lessons
    Eclipse's Avatar
    Join Date
    Aug 2012
    Posts
    4,436
    Thanks given
    686
    Thanks received
    898
    Rep Power
    490
    Just remove the parameters.

    Quote Originally Posted by jerryrocks317 View Post
    i am 14 and have my own laptop im on almost 24/7 currently creating rsps lol so please get off my thread lol
    Reply With Quote  
     

  3. #3  
    Banned
    Join Date
    Sep 2011
    Posts
    177
    Thanks given
    32
    Thanks received
    13
    Rep Power
    0
    Quote Originally Posted by Ninth Legion View Post
    Just remove the parameters.
    More detailed please. If there are no parameters i get an error whilst running.
    Reply With Quote  
     

  4. #4  
    Registered Member
    TheChosenOne's Avatar
    Join Date
    Jan 2013
    Posts
    967
    Thanks given
    47
    Thanks received
    161
    Rep Power
    366
    Ninth Legion means to 'hardcore' the parameters inside the main method.
    Reply With Quote  
     

  5. #5  
    Banned
    Join Date
    Sep 2011
    Posts
    177
    Thanks given
    32
    Thanks received
    13
    Rep Power
    0
    Main method in client:

    Spoiler for Client class:
    public static void main(String args[]) {
    try {
    String os = System.getProperty("os.name").toLowerCase();

    if (os.contains("windows") || os.contains("win")) {
    Client.windowsVersion = true;
    } else {
    Client.windowsVersion = false;
    }

    if (args.length > 0) {
    if (args[0].length() > 0) {
    world1Address = args[0].trim();
    }
    }
    if (args.length > 1) {
    if (args[1].length() > 0) {
    world2Address = args[1].trim();
    }
    }
    if (args.length > 2) {
    if (args[2].length() > 0) {
    world3Address = args[2].trim();
    }
    }

    if (args.length > 3) {
    if (args[3].length() > 0) {
    showButtons = Boolean.parseBoolean(args[3]);
    }
    }

    if (args.length > 4) {
    if (args[4].length() > 0) {
    debugMode = Boolean.parseBoolean(args[4]);
    }
    }

    System.out.println("Debug mode: " + debugMode);

    nodeID = 10;
    portOff = 0;
    setHighMem();
    isMembers = true;
    SignLink.storeid = 32;
    SignLink.startpriv(InetAddress.getLocalHost());
    // client client1 = new client();
    // client1.createClientFrame(503, 765);
    new Jframe(args);
    } catch (Exception exception) {
    // exception.printStackTrace();
    }
    }


    Args in Jframe:

    Spoiler for Jframe Args:
    public Jframe(String args[]) {
    super();
    try {
    SignLink.startpriv(InetAddress.getByName(world == 1 ? world1Address : world2Address));
    initUI();
    } catch (Exception ex) {
    ex.printStackTrace();
    }
    }


    Does that help at all? Cause I'm not quite sure what you're getting at.

    EDIT: Running world1Address server.
    Reply With Quote  
     

  6. #6  
    Banned
    Join Date
    Apr 2013
    Posts
    1
    Thanks given
    0
    Thanks received
    0
    Rep Power
    0
    Quote Originally Posted by 'Anarchy View Post
    Main method in client:

    Spoiler for Client class:
    public static void main(String args[]) {
    try {
    String os = System.getProperty("os.name").toLowerCase();

    if (os.contains("windows") || os.contains("win")) {
    Client.windowsVersion = true;
    } else {
    Client.windowsVersion = false;
    }

    if (args.length > 0) {
    if (args[0].length() > 0) {
    world1Address = args[0].trim();
    }
    }
    if (args.length > 1) {
    if (args[1].length() > 0) {
    world2Address = args[1].trim();
    }
    }
    if (args.length > 2) {
    if (args[2].length() > 0) {
    world3Address = args[2].trim();
    }
    }

    if (args.length > 3) {
    if (args[3].length() > 0) {
    showButtons = Boolean.parseBoolean(args[3]);
    }
    }

    if (args.length > 4) {
    if (args[4].length() > 0) {
    debugMode = Boolean.parseBoolean(args[4]);
    }
    }

    System.out.println("Debug mode: " + debugMode);

    nodeID = 10;
    portOff = 0;
    setHighMem();
    isMembers = true;
    SignLink.storeid = 32;
    SignLink.startpriv(InetAddress.getLocalHost());
    // client client1 = new client();
    // client1.createClientFrame(503, 765);
    new Jframe(args);
    } catch (Exception exception) {
    // exception.printStackTrace();
    }
    }


    Args in Jframe:

    Spoiler for Jframe Args:
    public Jframe(String args[]) {
    super();
    try {
    SignLink.startpriv(InetAddress.getByName(world == 1 ? world1Address : world2Address));
    initUI();
    } catch (Exception ex) {
    ex.printStackTrace();
    }
    }


    Does that help at all? Cause I'm not quite sure what you're getting at.

    EDIT: Running world1Address server.


    Wanna know what i did ?
    I just deleted the bin and src folder, so it is like this.
    "Client/*.java
    instead of
    "Client/src/*.java
    It will work without parameters there.
    Reply With Quote  
     

  7. #7  
    Banned
    Join Date
    Sep 2011
    Posts
    177
    Thanks given
    32
    Thanks received
    13
    Rep Power
    0
    Quote Originally Posted by I iz Lirim View Post
    Wanna know what i did ?
    I just deleted the bin and src folder, so it is like this.
    "Client/*.java
    instead of
    "Client/src/*.java
    It will work without parameters there.
    It runs fine. It just doesn't Jar. thanks though.
    Reply With Quote  
     

  8. #8  
    Registered Member
    TheChosenOne's Avatar
    Join Date
    Jan 2013
    Posts
    967
    Thanks given
    47
    Thanks received
    161
    Rep Power
    366
    As the first line in your main(String[] args) method, use this:
    args = new String[]{<YOUR ARGUMENTS SEPERATED BY COMMAS>}
    Reply With Quote  
     

  9. #9  
    Banned
    Join Date
    Sep 2011
    Posts
    177
    Thanks given
    32
    Thanks received
    13
    Rep Power
    0
    Still no luck, example or something?
    Code:
    args = new String[]{ip, ip, ip, true, false}
    Reply With Quote  
     

  10. #10  
    Registered Member
    TheChosenOne's Avatar
    Join Date
    Jan 2013
    Posts
    967
    Thanks given
    47
    Thanks received
    161
    Rep Power
    366
    Quote Originally Posted by 'Anarchy View Post
    Still no luck, example or something?
    Code:
    args = new String[]{ip, ip, ip, true, false}
    Like:
    Code:
    args = new String[]{"10", "0", "highmem", "members", "32"};
    This would be for my client arguments:
    The part in run.bat: "C:\Program Files\Java\jre7\bin\java" -Xmx300m -cp . Jframe 10 0 highmem members 32
    Reply With Quote  
     

Page 1 of 2 12 LastLast

Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Similar Threads

  1. Replies: 0
    Last Post: 12-25-2012, 01:02 AM
  2. Replies: 10
    Last Post: 10-20-2012, 06:54 PM
  3. [PI] Problems with npcs will +Rep and Thank!
    By ToxicPlanet in forum Help
    Replies: 4
    Last Post: 08-26-2012, 09:33 PM
  4. Replies: 6
    Last Post: 04-15-2012, 02:27 AM
  5. Help with webclient!will rep and thank !!
    By glad 2 own in forum Help
    Replies: 2
    Last Post: 11-15-2011, 04:04 AM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •