Making a minecraft server GUI

Discussion in 'Mac Programming' started by macguin, Apr 19, 2011.

  1. macguin macrumors newbie

    Jul 7, 2009
    I am really tired of looking at the terminal window, trying to decipher through time stamps and iChat formatting what people are asking me. I was thinking I could make GUI application that would be built around the craftbukkit.jar file. The only problem is I do not know how to execute .jars in a program, how to send commands to them, or receive and parse information from them (like logout events or chat). It there any way to do this?
  2. chown33 macrumors 604

    Aug 9, 2009
    Have you ever written any kind of program before? If so, in what language?

    Do you know what standard-input and standard-output streams are (stdin, stdout)?
  3. macguin, Apr 19, 2011
    Last edited: Apr 19, 2011

    macguin thread starter macrumors newbie

    Jul 7, 2009
    I have written several iPhone apps, so obviously objective c. Also Java and C++.
    Also applescript, but I personally don't consider it a real programming language.

    I have no experience with standard-input and standard-output (no idea what it means)
  4. Mac_Max macrumors 6502

    Mar 8, 2004
  5. chown33 macrumors 604

    Aug 9, 2009
    Then you will need to do some research before attempting to write your GUI front-end.

    Have you written any Java code that uses Runtime.exec() to run another program? If so, you may have used the Process's inputStream, outputStream, and errorStream to get data from the process, send data to the process, or read the error message from the process. All three streams are the "standard" streams of the child process: stdin, stdout, stderr (their C symbol names when using stdio.h).

    In a Java program, the, System.out, and System.err streams are that process's stdin, stdout, and stderr streams.

    In a shell command, < redirects stdin to a file, > redirects stdout, and 2> redirects stderr.

    In a shell pipeline, such as cat fee fie foo | sort, the stdout of the cat process is connected to the stdin of the sort process by a pipe (see: man 2 pipe). Both processes run concurrently. sort will wait for input, and cat will wait for its stdout pipe buffer to drain, so the processes never outrun one another nor are they starved for data.
  6. macguin, Apr 20, 2011
    Last edited: Apr 20, 2011

    macguin thread starter macrumors newbie

    Jul 7, 2009
  7. chown33 macrumors 604

    Aug 9, 2009
    You don't. The launch path should be the 'java' command, which is responsible for running the Java classes in the jar.

    You'll need to know the full path of the java command, so in a Terminal window, enter this command:
    which java
    The path it tells you is a standardized location, but I'm telling you how to do this so you know it for other commands.

    You'll also need to read the man page for the java command, so you know how to tell it that the minecraft_server.jar is a jar-file and not a class, a defined system property, or some other parameter.

Share This Page