Minecraft Wiki
m (→‎Additional Notes: Moved the pause advice to additional notes)
Noreplyz (talk | contribs)
(cleanup)
Tag: Undo
 
(99 intermediate revisions by 57 users not shown)
Line 1: Line 1:
  +
Before beginning this tutorial, note that the following guides are '''only''' for the 2.x launcher. If you want to make Minecraft portable for an older launcher version, please view [[Tutorials/Playing and saving Minecraft on a thumb drive with the old launcher|this]] page instead.
{{ScriptWarning}}
 
This tutorial explains how to run Minecraft on a portable (Thumb, Flash, or USB) drive . This is useful if you want to keep your game data (worlds, saves data, resource packs, server list, etc.) when switching computers, as the game data will stay on the portable drive.
 
   
  +
This tutorial explains '''how to run Minecraft on a portable location (e.g. on a thumb drive)'''. Portable installation is, an installation that is not "integrated" with the computer, which is useful for managing multiple installations and generally keeping things organised. This is useful if you want to retain your game data (launcher profiles, worlds, resource packs, etc.) when switching computers.
== Prerequisites ==
 
You will need:
 
* A portable (Thumb/Flash/USB) drive with at least 512MB of space. You may need more space as Minecraft saves more data to your portable drive.
 
* A computer that runs Windows, OS X, or any Linux distribution that meets the [https://help.mojang.com/customer/portal/articles/325948-minecraft-system-requirements Minecraft system requirements] and has [http://https://www.java.com/en/ Java] installed.
 
   
  +
'''''If you are not planning to play Minecraft on a thumb drive but on your main hard drive instead, it's highly recommended for you to make the game portable with this guide''''' because this will give you some big advantages over standard installation. If you store different Minecraft versions (1.8, 1.12, modded 1.12, modded 1.7.10, latest, etc.) in one folder/launcher instance, mods/worlds/settings from other versions may conflict with version you are currently playing. If you want to separate them on standard installation, you will have to also keep each folder of each version in <code>[[.minecraft|.minecraft directory]]</code> and rename them every time you want to change version you are currently playing. On portable installation only a folder and launcher script file is needed to be created and after following this guide you can just play selected version just by double-clicking on its script file.
== Procedures ==
 
=== Instructions for Windows ===
 
==== Preparation ====
 
   
  +
'''Note:''' After this guide the game will be only 99% portable: the game data will be stored and used by game and its launcher where you want but launcher will create [[.minecraft|<code>.minecraft directory</code>]] anyway and will be placing there (just only) its log files (like update logs, logs with game messages and crashes, etc.) If you really care about it, you can combine this guide with [[Tutorials/Playing and saving Minecraft on a thumb drive with the old launcher|the guide for the old launcher]]: the game will create [[.minecraft|<code>.minecraft directory</code>]] if it doesn't exist anyway but will just leave it empty<sup>[unverified]</sup>.
As Minecraft requires more than the single one file to be installed, we will collect all the files needed to run and sort them onto the portable drive for easy access. Please note that if you do not do this correctly, Minecraft may crash or fail to start. All folder and file names in the Windows guide are case sensitive.
 
   
  +
== Instructions (for Windows) ==
* Insert your portable drive into your computer, and open it.
 
  +
'''Note:''' The following Windows tutorial will guide you through installing the game to <code>D:\Games\PortableMinecraft\</code>. However, this guide can be used to install the game to any directory. When following this guide, replace this directory with the directory you actually want to install the game to. Please also note that while this guide was written for Windows, it is still largely applicable to other operating systems with minor changes.
* Create a folder, name it '''Minecraft Portable''' (or any name you choose) and enter the folder.
 
* In that folder, create two new folders and name them '''Launcher''' and '''Data'''
 
** Note: It is strongly recommended to use the exact names as outlined in this tutorial to get the best results.
 
** There are now three folders on the portable drive, '''Launcher''' and '''Data''', both within '''Minecraft Portable'''.
 
   
  +
Navigate to the portable drive in the file explorer, and create the <code>D:\Games\PortableMinecraft\</code> directory. Next, create <code>Launcher</code> folder for launcher with its data and <code>MyMinecraft</code> folder (or another name of your choosing) for game data.
==== Launcher ====
 
   
  +
If you have existing game data, you can move it to the desired directory. Navigate to the <code>[[.minecraft]]</code> folder and copy all of its contents (but not the folder itself) into <code>D:\Games\PortableMinecraft\MyMinecraft</code>.
Add the launcher/client to the portable drive:
 
   
  +
Now you need to move the launcher. [https://www.minecraft.net/download/alternative Download] <code>Minecraft.exe</code> (if you don't have it) and move it to <code>D:\Games\PortableMinecraft\Launcher</code>.
* Download the Minecraft launcher.
 
** You can download it from this [https://s3.amazonaws.com/Minecraft.Download/launcher/Minecraft.exe direct link] or by visiting the [https://minecraft.net/download Minecraft Downloads page].
 
** Make sure you use the "Minecraft for Windows (alternative)" version. This can be found by clicking on "Show all platforms" on the page.
 
* Copy the Minecraft.exe to the '''Launcher''' folder that you have created on the portable drive.
 
   
  +
Create an empty text file called <code>MyMinecraft.bat</code> (or another name of your choosing) in the <code>D:\Games\PortableMinecraft\</code> directory.
==== Data Files ====
 
   
  +
Open the batch file with notepad or another text editor and paste the following text into it before saving the file:<syntaxhighlight lang="bat">
This section will guide you on copying your game data (worlds, saves data, resource packs, server list, etc.) onto the portable drive.
 
  +
@echo off
If you do not want to copy your game data, you may skip this section.
 
  +
start "" "%cd%\Launcher\Minecraft.exe" --workDir "%cd%\MyMinecraft"
  +
</syntaxhighlight>Everything is now finished. When you want to play, just use the batch file to launch the game. Do '''not''' start the launcher directly (without using the batch file), or the game will just use the default directory in <code>%APPDATA%</code> as its working directory. It is recommended to set the launcher's executable to have the "hidden" attribute to avoid accidentally running it. You could also make a shortcut on the Desktop to run the bat file without having to find it.
   
  +
== Instructions (for Linux) ==
The '''.minecraft''' folder contains all of your current game data.
 
  +
'''Note:''' The following tutorial assumes that the USB disk is located (and mounted) at <code>/media/user/USBDisk</code>, and that you would like to have portable Minecraft at <code>/media/user/USBDisk/minecraft-portable</code>. However, this guide can be used to install the game to any directory. When following this guide, replace this directory with the directory you actually want to install the game to.
   
  +
'''Important preparation:''' You need to make sure that you have correct java version installed because linux launcher doesn't have its own java. If you want to play Minecraft versions less than 1.13, you should have Java 8 installed and selected as default in your system because Minecraft versions earlier than 1.13 don't support Java 11, they will just simply crash at launch.
* Press {{key|Windows}} + {{key|R}}
 
** Enter '''%APPDATA%''' and click OK.
 
* Locate your '''.minecraft''' folder and copy it
 
* Copy the '''.minecraft''' folder and paste it into the '''Data''' folder
 
   
  +
Depending on the GNU/Linux disro commands may vary.
==== Setting Up ====
 
   
  +
Firstly, check which version of java is currently used in your system:
Now that all the data files are there, we need to tell Windows to point Minecraft to the files on the portable drive. To do this, we will create a [http://en.wikipedia.org/wiki/Batch_file batch file].
 
   
  +
<code>java -version</code>
* Open Notepad or a similar text editor.
 
** Press {{key|Windows}} + {{key|R}}
 
** Enter '''notepad''' and click OK.
 
* Copy and paste the following into the text editor.:
 
   
  +
If your java(or openjdk, doesn't matter) version in the first output line doesn't look like <code>"1.8.0_xxx"</code> (but instead looks like <code>"1.7.0_xxx"</code>, <code>"9"</code>, <code>"11.x.x"</code>, <code>"14"</code>, etc.), it means that Java 8 isn't installed or selected as default on your system.
set APPDATA=%CD%\Data<br>
 
Launcher\Minecraft.exe
 
   
  +
Secondly, install Java 8 package on your system (depending on the distro the package name can be <code>openjdk-8-jdk</code>, <code>jdk8-openjdk</code>, <code>java8-openjdk</code>, <code>java-1_8_0-openjdk</code>, etc.) via terminal or graphical package manager. If your distro repositories don't have Java 8 package, maybe [https://stackoverflow.com/questions/57031649/how-to-install-openjdk-8-jdk-on-debian-10-buster this] can help.
*If you would like to use Minecraft.jar, copy and paste this instead:
 
   
  +
Finally, run the following command and select the path containing previously installed Java 8 package name:
set APPDATA=%CD%\Data<br>
 
java -jar Launcher\Minecraft.jar
 
   
  +
<code>sudo update-alternatives --config java</code>
* Now click File > Save As ...
 
* Navigate into your '''Minecraft Portable''' folder (''not '''Data''''').
 
* Name this file "StartMinecraft.bat"
 
** Note: Make sure to include the quotation marks (""), or else Notepad will try correct it to StartMinecraft.bat.txt and it will not work.
 
   
  +
Now, you are ready to install the game.
==== Playing ====
 
*Once you have completed Setting Up, you can now launch Minecraft portable by running the StartMinecraft.bat file you have created.
 
*When the launcher appears, click Play to begin.
 
   
=== Instructions for Linux ===
 
{{msgbox
 
| bgcol = #FFCCCC
 
| linecol = #FFAAAA
 
| title = Warning
 
| text = The following instructions may require administrative or superuser privileges, and can possibly cause damage to your system. Proceed with caution.
 
}}
 
Assume that the portable drive is at '''/dev/sdb1''' and that Minecraft is installed at '''~/games/.minecraft'''.
 
* '''Note''': You may need to use a different directory name depending on your distribution and set-up.
 
   
  +
Start by creating directory for the game:
Run the following in a terminal:
 
*'''Note''': The following commands require may require superuser privileges. Make sure you are running these as root or are using sudo.
 
*'''Note''': Text following the '''#''' symbol are comments, and can be omitted for that line.
 
umount /dev/sdb1
 
mkdir /media/minecraft
 
mount /dev/sdb1 /media/minecraft
 
mkdir /media/minecraft/games # If there is a folder called games in your portable drive, skip this command
 
cp - rn ~/games/.minecraft /media/minecraft/ # This might take a while
 
cd
 
umount /dev/sdb1
 
rm /media/minecraft # Check to make sure that your portable drive in not mounted!
 
   
  +
<code>cd /media/user/USBDisk</code>
After that, to launch Minecraft, enter the following in the terminal with superuser privileges.
 
umount /dev/sdb1
 
mkdir ~/games # If there is a folder called games in your home directory, skip this command
 
mount /dev/sdb1 ~/games # You will not be able to play any games that are saved in the ~/games directory
 
   
  +
<code>mkdir minecraft-portable && cd minecraft-portable</code>
Run the Minecraft launcher to start playing.
 
   
  +
Next, create <code>myminecraft</code> folder (or another name of your choosing) for your Minecraft game data:
=== Instructions for OS X ===
 
{{msgbox
 
| title = Notice
 
| text = This guide does not make Minecraft truly portable, as it requires you to copy the game data from and to the portable drive each time you play.
 
}}
 
   
  +
<code>mkdir myminecraft</code>
==== Setting Up ====
 
** Locate your Minecraft files. Press Command+Shift+G while in finder and then paste ~/Library/application support/minecraft into the dialog.
 
** Copy that minecraft folder in your application support folder.
 
** Insert in your portable drive and make 2 folders in it:
 
*** '''data''' and '''launcher'''
 
** Paste your minecraft folder into the "data" folder in the portable drive.
 
** Drag your launcher into the "launcher" folder
 
** Remove your portable drive
 
   
  +
Now, at this point, if you would like to copy all your existing game data, run the following command:
==== Playing ====
 
Once you are done setting up, you can test if your Minecraft can start on another Mac.
 
** Insert your portable drive into another Mac to test
 
** Open the launcher folder and move the Minecraft launcher into your Applications folder.
 
** Double click the launcher to run it. Then after Minecraft loads, exit it.
 
** Again, go to Users/USERNAME/Library/Application Support
 
** In "Application Support", delete the minecraft folder.
 
** Move the minecraft folder in your data folder on your portable drive to the desktop.
 
** Then drag it from your desktop into application support.
 
** Run Minecraft again.
 
   
  +
<code>cp -r ~/.minecraft ./myminecraft</code>
== Additional Notes ==
 
   
  +
You now need to download the Minecraft Launcher. Do so by running the following command:
* To install resource packs or mods onto the portable drive, use the '''.minecraft''' folder of that portable drive.
 
* For Windows, if you would like to have multiple .minecraft ("Data") folders, say, in order to quickly switch to an older version of Minecraft, or perhaps play with mods, make multiple "Data" folders, with different names ("1.6.4", "Modded", and so forth) and a batch file for each one. You may have to make a second "Drive" folder if you want to use 1.5.2 or before, as that uses an older launcher. This is not required.
 
* For Windows, if there seems to be a problem and the command window closes before you can see what the issue is, add "pause" on a new line and will prompt you to press any key before exiting.
 
   
  +
<code>wget -O launcher.tar.gz <nowiki>https://piston-data.mojang.com/download/Minecraft.tar.gz</nowiki></code>
== Source ==
 
   
  +
Next, extract the <code>minecraft-launcher</code> folder by using your favourite extraction utility. This tutorial assumes the extracted folder is located in <code>/media/user/USBDisk/minecraft-portable</code>.
If you have any trouble understanding, the original guide can be found in [http://www.minecraftforum.net/topic/814010-100how-to-play-minecraft-off-your-usb-drive-any-computer-any-minecraft-version/ this thread].
 
   
  +
All the basic setup is completed. You will find the launcher at <code>/media/user/USBDisk/minecraft-portable/minecraft-launcher/minecraft-launcher</code>
   
  +
To open the launcher correctly, you can run the following command:
== Alternative Methods ==
 
   
  +
<code>/media/user/USBDisk/minecraft-portable/minecraft-launcher/minecraft-launcher -w /media/user/USBDisk/minecraft-portable/myminecraft</code>
=== Cryshal's Method===
 
   
  +
But the better way is to use a shell script and run it when you want to play Minecraft. Create empty file called <code>myminecraft.sh</code> (or another name of your choosing) with the following text:
''Doesn't work, minecraft still runs from the appdata folder, Minecraft Profile Manager is useless, and java will not run from the flash drive.''
 
  +
<syntaxhighlight lang="sh">
''
 
  +
#!/bin/bash
   
  +
"$(dirname "$(readlink -f "$0")")"/minecraft-launcher/minecraft-launcher -w "$(dirname "$(readlink -f "$0")")"/myminecraft
What you need:
 
  +
# Note: "$(dirname "$(readlink -f "$0")")" is the directory path of this script current location, like %cd% in Windows
*A flash drive. (I'd suggest around 2GB, but varies depending on how many worlds/texture packs you have)
 
  +
</syntaxhighlight>
*Windows
 
  +
Then make it executable:
   
  +
<code>chmod +x myminecraft.sh</code>{{tutorials}}
   
  +
[[zh:教程/在U盘中运行及保存Minecraft]]
*First, create a folder named, say, "Flash MC". Then, go on over to get [http://portableapps.com/apps/utilities/java_portable/ jPortable] which lets you run Java right on your flash drive, without it being installed on the computer.
 
 
*You will want to install that onto your flash drive in a directory like \Flash MC\jPortable.
 
 
*Then, go to [http://www.minecraftforum.net/topic/540449-minecraft-profile-manager/ Minecraft Profile Manager]'s thread, and download it.
 
*Put it into your Portable MC folder. Follow the instructions. (Put minecraft.exe into the same folder that it is in)
 
*You should now be able to launch MPM, make a profile and download all the needed Minecraft files to play.
 
 
====Note====
 
*MPM runs using JAVA, meaning you must have java running in order for it to work.
 
*Computers that are running windows should work just fine, unless they haven't been using Microsoft update.
 
I hope this helps you!
 
 
===HiWiki's Method===
 
{{msgbox
 
| bgcol = #CCA300
 
| linecol = #DBBF4D
 
| title = WARNING
 
| text = Please follow the steps '''CAREFULLY''' to avoid minecraft crashing!<br>This part was made by HiWiki!
 
}}
 
'''WARNING''' - Do it in your own risk!<br>
 
Only Works in '''WINDOWS!'''
 
 
*In this method you will need:
 
**
 
**USB (Minimum Space is 2.5GB or more if you have mods and/or texturepacks (You will also need Additional space for worlds))
 
**Notepad
 
**Minecraft Client
 
**And .minecraft folder
 
 
====Steps====
 
 
*First things first! You need to make two folders named '''bin''' and '''data'''
 
*Then you place minecraft client inside '''bin''' folder
 
**If you use a jar (or anything else that run minecraft) will still be placed in the '''bin''' folder
 
*But the data of minecraft isn't in the '''data''' folder yet,
 
**So you will need to Press {{key|Windows}} + {{key|R}} to open run and type in the dialog box %appdata% then copy .minecraft folder (Also include other folders that also included in minecraft such as .aether)
 
***Select those folders then press {{key|Ctrl}} + {{key|C}} (or {{key|Ctrl}} + {{key|X}} if you want to move the files rather than copy it)
 
*Then after that Press {{key|Windows}} + {{key|R}} to open run again and type notepad then paste the following code in it:
 
SET APPDATA=%CD%\data<br>
 
bin\minecraft.exe
 
 
*But if you use a Jar, put this instead:
 
 
SET APPDATA=%CD%\data<br>
 
bin\minecraft.jar
 
 
*And if you use a Jar/Exe with a different name such as Minecraft-launcher put this
 
 
SET APPDATA=%CD%\data<br>
 
bin\<name of launcher>.<jar/exe>
 
 
*Then you are all done!
 
 
====Note!====
 
*You will need Java for this, but if you also want java in your Flash/Thumb/USB drive, see the section titled '''Add Portable Java''' below.
 
*Any data you have in your .minecraft in appdata will also be in your Flash/Thumb/USB drive
 
 
====Add Portable Java Method====
 
'''You will need an extra 0.5 GB in your Drive for this to work!'''
 
 
*Now you have done the above
 
*Time to add portable java! (YAY!)
 
*1st, Click this <span class="plainlinks">[http://portableapps.com/download link]</span>
 
*Then on the page that redirected you, click <span class="plainlinks">[http://downloads.sourceforge.net/portableapps/PortableApps.com_Platform_Setup_11.2.exe?accel_key=69%3A1396263552%3Ahttp%253A//portableapps.com/download%3A9d865d8b%243f3c86b4e6edabada0df0f9217933d7a908de328&click_id=7dfd50b4-b8c3-11e3-aacb-0200ac1d1daa&source=accel Download Now or this link]</span>
 
*Then open PortableApps.com_Platform_Setup_11.2.exe then wait until you see the add apps section
 
**Make sure you place the setup in the Flash/Thumb/USB drive!
 
*Then in utilities find and tick the boxes jPortable,jPortable Launcher,jPortable Browser switch then press install
 
*Then wait for it to install then after that, your done!
 
 
====How to open jPortable====
 
*First, find the folder PortableApps in your Flash/Thumb/USB drive
 
*Then double click start, Then press jPortable Launcher
 
*A window will open, then find the jar (Don't worry if it shows jar can be opened only change it to all files then find your exe)
 
*Then after that press open then your minecraft will open
 
 
====Issues and how to fix them====
 
*The minecraft directory is not there, if that happens then press edit profile then find and locate your data folder in file explorer then right click it then press properties
 
**Also in the edit profile window tick the '''Game directory''' box
 
**Now a window should open, so you will Select the text by dragging in the ''Location'' Line then paste it in the '''Game directory''' box then include this \.minecraft or paste it in the '''Game directory''' box
 
*Then you are done!
 
 
====Credits====
 
This part was made by HiWiki!
 
If there is information that is not here, then I did not made it, then also PM so I can restore it
 
If there's any problem PM me and i'll help you (But not all the time)
 
The original source can be found in <span class="plainlinks">[http://www.minecraftforum.net/topic/814010-100how-to-play-minecraft-off-your-usb-drive-any-computer-any-minecraft-version/ this thread]</span>.
 
 
I hope this part helps you!
 
 
====Changing the launcher file to use an autorun.inf====
 
If you are using an autorun.inf instead of using
 
 
set APPDATA=%CD%\data<br>
 
bin\minecraft.exe
 
 
or
 
 
set APPDATA=%CD%\data<br>
 
bin\minecraft.jar
 
 
change the file to this:
 
 
set APPDATA="Minecraft portable\data"
 
cd "Minecraft portable\drive\"
 
Minecraft.jar
 
 
==Video Tutorial==
 
A video tutorial showing the step-by-step procedure on how to make Minecraft portable and run it from a USB thumb drive without Java installed
 
 
{{#ev:youtube|b3Ni5JCxfAM}}
 
 
 
{{tutorials}}
 

Latest revision as of 00:53, 13 November 2023

Before beginning this tutorial, note that the following guides are only for the 2.x launcher. If you want to make Minecraft portable for an older launcher version, please view this page instead.

This tutorial explains how to run Minecraft on a portable location (e.g. on a thumb drive). Portable installation is, an installation that is not "integrated" with the computer, which is useful for managing multiple installations and generally keeping things organised. This is useful if you want to retain your game data (launcher profiles, worlds, resource packs, etc.) when switching computers.

If you are not planning to play Minecraft on a thumb drive but on your main hard drive instead, it's highly recommended for you to make the game portable with this guide because this will give you some big advantages over standard installation. If you store different Minecraft versions (1.8, 1.12, modded 1.12, modded 1.7.10, latest, etc.) in one folder/launcher instance, mods/worlds/settings from other versions may conflict with version you are currently playing. If you want to separate them on standard installation, you will have to also keep each folder of each version in .minecraft directory and rename them every time you want to change version you are currently playing. On portable installation only a folder and launcher script file is needed to be created and after following this guide you can just play selected version just by double-clicking on its script file.

Note: After this guide the game will be only 99% portable: the game data will be stored and used by game and its launcher where you want but launcher will create .minecraft directory anyway and will be placing there (just only) its log files (like update logs, logs with game messages and crashes, etc.) If you really care about it, you can combine this guide with the guide for the old launcher: the game will create .minecraft directory if it doesn't exist anyway but will just leave it empty[unverified].

Instructions (for Windows)

Note: The following Windows tutorial will guide you through installing the game to D:\Games\PortableMinecraft\. However, this guide can be used to install the game to any directory. When following this guide, replace this directory with the directory you actually want to install the game to. Please also note that while this guide was written for Windows, it is still largely applicable to other operating systems with minor changes.

Navigate to the portable drive in the file explorer, and create the D:\Games\PortableMinecraft\ directory. Next, create Launcher folder for launcher with its data and MyMinecraft folder (or another name of your choosing) for game data.

If you have existing game data, you can move it to the desired directory. Navigate to the .minecraft folder and copy all of its contents (but not the folder itself) into D:\Games\PortableMinecraft\MyMinecraft.

Now you need to move the launcher. Download Minecraft.exe (if you don't have it) and move it to D:\Games\PortableMinecraft\Launcher.

Create an empty text file called MyMinecraft.bat (or another name of your choosing) in the D:\Games\PortableMinecraft\ directory.

Open the batch file with notepad or another text editor and paste the following text into it before saving the file:

@echo off
start "" "%cd%\Launcher\Minecraft.exe" --workDir "%cd%\MyMinecraft"

Everything is now finished. When you want to play, just use the batch file to launch the game. Do not start the launcher directly (without using the batch file), or the game will just use the default directory in %APPDATA% as its working directory. It is recommended to set the launcher's executable to have the "hidden" attribute to avoid accidentally running it. You could also make a shortcut on the Desktop to run the bat file without having to find it.

Instructions (for Linux)

Note: The following tutorial assumes that the USB disk is located (and mounted) at /media/user/USBDisk, and that you would like to have portable Minecraft at /media/user/USBDisk/minecraft-portable. However, this guide can be used to install the game to any directory. When following this guide, replace this directory with the directory you actually want to install the game to.

Important preparation: You need to make sure that you have correct java version installed because linux launcher doesn't have its own java. If you want to play Minecraft versions less than 1.13, you should have Java 8 installed and selected as default in your system because Minecraft versions earlier than 1.13 don't support Java 11, they will just simply crash at launch.

Depending on the GNU/Linux disro commands may vary.

Firstly, check which version of java is currently used in your system:

java -version

If your java(or openjdk, doesn't matter) version in the first output line doesn't look like "1.8.0_xxx" (but instead looks like "1.7.0_xxx", "9", "11.x.x", "14", etc.), it means that Java 8 isn't installed or selected as default on your system.

Secondly, install Java 8 package on your system (depending on the distro the package name can be openjdk-8-jdk, jdk8-openjdk, java8-openjdk, java-1_8_0-openjdk, etc.) via terminal or graphical package manager. If your distro repositories don't have Java 8 package, maybe this can help.

Finally, run the following command and select the path containing previously installed Java 8 package name:

sudo update-alternatives --config java

Now, you are ready to install the game.


Start by creating directory for the game:

cd /media/user/USBDisk

mkdir minecraft-portable && cd minecraft-portable

Next, create myminecraft folder (or another name of your choosing) for your Minecraft game data:

mkdir myminecraft

Now, at this point, if you would like to copy all your existing game data, run the following command:

cp -r ~/.minecraft ./myminecraft

You now need to download the Minecraft Launcher. Do so by running the following command:

wget -O launcher.tar.gz https://piston-data.mojang.com/download/Minecraft.tar.gz

Next, extract the minecraft-launcher folder by using your favourite extraction utility. This tutorial assumes the extracted folder is located in /media/user/USBDisk/minecraft-portable.

All the basic setup is completed. You will find the launcher at /media/user/USBDisk/minecraft-portable/minecraft-launcher/minecraft-launcher

To open the launcher correctly, you can run the following command:

/media/user/USBDisk/minecraft-portable/minecraft-launcher/minecraft-launcher -w /media/user/USBDisk/minecraft-portable/myminecraft

But the better way is to use a shell script and run it when you want to play Minecraft. Create empty file called myminecraft.sh (or another name of your choosing) with the following text:

#!/bin/bash

"$(dirname "$(readlink -f "$0")")"/minecraft-launcher/minecraft-launcher -w "$(dirname "$(readlink -f "$0")")"/myminecraft
# Note: "$(dirname "$(readlink -f "$0")")" is the directory path of this script current location, like %cd% in Windows

Then make it executable:

chmod +x myminecraft.sh