Bash – Create Bash File to Open Minecraft Launcher

bashcommand linejavaminecraft

I use this command in the terminal to run the minecraft launcher with java 8:

/home/max/Java/jre1.8.0_25/bin/java -jar Minecraft.jar

I included the full java path because I installed it on /home as a normal user and i want to include it.

That command works, it opens the launcher with Java 8 but I want to make a bash file so I don't have to open the terminal. And, most important, I don't want the terminal to remain open when I click play in the Minecraft launcher and the game starts.

Now if i close manually the terminal when the game have started, the game is closed too.

Best Answer

If you are using linux you probably like to see different ways of "living". I suggest you the hard way:

  1. open a terminal (I can not survive with less than 3 terminals opened) and keep it opened! And learn how to do everything with commands.
  2. create a ~/bin directory for your commands (mkdir ~/bin)
  3. add ~/bin the PATH
  4. create a command named minecraft (using @Sudheer, using an editor or by

    echo -e '#!/bin/bash'
    /home/max/Java/jre1.8.0_25/bin/java -jar Minecraft.jar' > ~/bin/minecraft
    chmod 755 ~/bin/minecraft
    
  5. instead of clicking, just write minecraft in your terminal.

Related Question