Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I recently bought Minecraft and installed it on Ubuntu (I have played it on a Windows with no problems). I have JDK Java 6 runtime. When I try to open Minecraft with Java it gives me an error message that says it is not marked as executable. It is .jar. Do I need to convert it to .exe? If so, how? I am relatively new to Ubuntu and would appreciate any help!

share|improve this question
    
Welcome to AskUbuntu! I'd take a look at the following question and answers which should help you, especially the one by Christopher David Chen in your case: How can I install Minecraft –  Oyibo Oct 27 '12 at 15:02

3 Answers 3

In order to mark the file as executable using terminal you can use the following

sudo chown -X path/to/minecraft.jar
share|improve this answer

The solution is simple. Navigate to the .jar file in Nautilus(File manager) and right-click it. Go to the Permissions tab and check the box labeled:

Allow executing file as program

This sets the executable bit the JDK was complaining about.

But why is this, and what is this "executable bit" thingy?

In Linux, file extensions have less of a role in determining what to do with files. Instead, Linux uses magic numbers, which are basically headers. If you are familiar with Linux scripting, the shebang (The #! at the beginning) is a human-readable header, also. Executables have a header that may contain ELF or ELF64 if they are Linux Elfs(program files and libraries). However, this is not the only check.

Linux also keeps file permissions. It stores the user and group IDs for each file and directory and a lost of what the owner, group, and everyone can do. Included in this is the executable bit. If you chmod a+x the file or follow the graphical instructions I gave above, you set this bit telling Linux, and programs like Java and Wine that they should be allowed to run the file. If this bit is unset by unchecking the box or chmod a-x file, then the bit not being set tells Linux and software that would want to execute it not to do so for security. This does not apply to source code, however.

share|improve this answer

I had the same problem when I used "open with java" but you don't have to alter permissions to play . By launching it from command line with java -jar minecraft.jar (assuming you are in the right folder) it will open regardless.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.