Skip to main content

Alright i amI'm trying to create a custom name laucher for minecraftMinecraft. I run aan offline server and was wanting to give some of my friends a laucher to use so they can play. I have done this before with a batch file. Now i amI'm using java UIJavaUI and i amI'm trying to start minecraftMinecraft from the javaJava program. I have yet to get minecraftMinecraft to pop up. 

Here is the code i am using:

if (e.getSource() == app.startNorm){
            //JOptionPane.showMessageDialog(null, "Your username is \"" + System.getProperty("user.name") + "\"");
            List<String> command = new ArrayList<String>();
            command.add("java");
            command.add("-jar");
            command.add(System.getenv("APPDATA") + "\\.minecraft\\bin\\* -Djava.library.path=\"" + System.getenv("APPDATA") + "\\.minecraft\\bin\\natives\" net.minecraft.client.Minecraft CustomNameHere");
        try{
            //line below wont work
            ProcessBuilder builder = new ProcessBuilder(command);
            Process proc = builder.start();
            app.setSize(500, 300);
            app.process.setVisible(true);
            app.memory.setVisible(false);
            app.start.setVisible(false);
            InputStream in = proc.getInputStream();
        } catch (IOException e1) {
            //always get dialog, when not never see minecraft pop up
            JOptionPane.showMessageDialog(null, "There was a problem with starting minecraft"Minecraft");
        }
    }

I was hoping someone could show me how to get this, or any other way to lauch minecraftMinecraft from inside my program.

Alright i am trying to create a custom name laucher for minecraft. I run a offline server and was wanting to give some of my friends a laucher to use so they can play. I have done this before with a batch file. Now i am using java UI and i am trying to start minecraft from the java program. I have yet to get minecraft to pop up. Here is the code i am using:

if (e.getSource() == app.startNorm){
            //JOptionPane.showMessageDialog(null, "Your username is \"" + System.getProperty("user.name") + "\"");
            List<String> command = new ArrayList<String>();
            command.add("java");
            command.add("-jar");
            command.add(System.getenv("APPDATA") + "\\.minecraft\\bin\\* -Djava.library.path=\"" + System.getenv("APPDATA") + "\\.minecraft\\bin\\natives\" net.minecraft.client.Minecraft CustomNameHere");
        try{
            //line below wont work
            ProcessBuilder builder = new ProcessBuilder(command);
            Process proc = builder.start();
            app.setSize(500, 300);
            app.process.setVisible(true);
            app.memory.setVisible(false);
            app.start.setVisible(false);
            InputStream in = proc.getInputStream();
        } catch (IOException e1) {
            //always get dialog, when not never see minecraft pop up
            JOptionPane.showMessageDialog(null, "There was a problem with starting minecraft");
        }
    }

I was hoping someone could show me how to get this or any other way to lauch minecraft from inside my program

I'm trying to create a custom name laucher for Minecraft. I run an offline server and was wanting to give some of my friends a laucher to use so they can play. I have done this before with a batch file. Now I'm using JavaUI and I'm trying to start Minecraft from the Java program. I have yet to get Minecraft to pop up. 

Here is the code i am using:

if (e.getSource() == app.startNorm){
    List<String> command = new ArrayList<String>();
    command.add("java");
    command.add("-jar");
    command.add(System.getenv("APPDATA") + "\\.minecraft\\bin\\* -Djava.library.path=\"" + System.getenv("APPDATA") + "\\.minecraft\\bin\\natives\" net.minecraft.client.Minecraft CustomNameHere");
    try{
        //line below wont work
        ProcessBuilder builder = new ProcessBuilder(command);
        Process proc = builder.start();
        app.setSize(500, 300);
        app.process.setVisible(true);
        app.memory.setVisible(false);
        app.start.setVisible(false);
        InputStream in = proc.getInputStream();
    } catch (IOException e1) {
        //always get dialog, when not never see minecraft pop up
        JOptionPane.showMessageDialog(null, "There was a problem with starting Minecraft");
    }
}

I was hoping someone could show me how to get this, or any other way to lauch Minecraft from inside my program.

Source Link
HcgRandon
  • 202
  • 1
  • 3
  • 9

Minecraft custom name laucher

Alright i am trying to create a custom name laucher for minecraft. I run a offline server and was wanting to give some of my friends a laucher to use so they can play. I have done this before with a batch file. Now i am using java UI and i am trying to start minecraft from the java program. I have yet to get minecraft to pop up. Here is the code i am using:

if (e.getSource() == app.startNorm){
            //JOptionPane.showMessageDialog(null, "Your username is \"" + System.getProperty("user.name") + "\"");
            List<String> command = new ArrayList<String>();
            command.add("java");
            command.add("-jar");
            command.add(System.getenv("APPDATA") + "\\.minecraft\\bin\\* -Djava.library.path=\"" + System.getenv("APPDATA") + "\\.minecraft\\bin\\natives\" net.minecraft.client.Minecraft CustomNameHere");
        try{
            //line below wont work
            ProcessBuilder builder = new ProcessBuilder(command);
            Process proc = builder.start();
            app.setSize(500, 300);
            app.process.setVisible(true);
            app.memory.setVisible(false);
            app.start.setVisible(false);
            InputStream in = proc.getInputStream();
        } catch (IOException e1) {
            //always get dialog, when not never see minecraft pop up
            JOptionPane.showMessageDialog(null, "There was a problem with starting minecraft");
        }
    }

I was hoping someone could show me how to get this or any other way to lauch minecraft from inside my program