1

I'm trying to get the minecraft.jar file to execute , but the check box won't come up when I go to Properties > Permissions. I don't know much about the terminal and its commands so if someone could post a simple step by step solution on how to mark it that would be great. People keep saying to use a chmod command but I have no idea what that is, so you are forewarned if I say "over my head".

  • jars don't need to be executable. you can launch them with an interpreter just like python and have a launcher script (which I think is the generally accepted practice). – RobotHumans Sep 19 '13 at 0:13
  • 1
    Have you tried right clicking the jar, and selecting "Open With > OpenJDK (or whatever java)"? – Richard Sep 19 '13 at 0:13
3

Assuming the file in question is in your $HOME (just move it with the GUI otherwise), open a terminal (that much should be easy :) then run this command:

chmod a+x jarfile.jar

Change jarfile.jar to the actual name of the file in question of course. If that gives you an error, the file is probably not owned by your user, so try again with sudo:

sudo chmod a+x jarfile.jar
| improve this answer | |
  • Files in your home directory should not be owned by root – kiri Sep 19 '13 at 0:13
  • It worked perfectly! – Ben Sep 19 '13 at 0:17
  • @terdon Iknow it says I have to wait 5 minuets – Ben Sep 19 '13 at 0:20
  • and I need 15 rep – Ben Sep 19 '13 at 0:20
  • @minerz029 that depends on who put them there. There is nothing that stops them from being owned by root. Try sudo touch foo; ls -l foo. – terdon Sep 19 '13 at 0:21
1

Jar files are supposed to be executed like I've shown below (assuming you have configured JRE/JDK in the execution search path):

java -jar /path/to/jarfile.jar

You CANNOT directly execute a JAR file even if you add the execute bit. By itself bash is simply not able to understand it.

A simple shell script will be ideal to run Minecraft, for example:

#!/bin/bash
java -Xms1024M -Xmx1024M -jar /path/to/mincraft.jar
| improve this answer | |
  • 1
    You are able to mark it as executable then open it with a double click. You just need to associate the MIME type with Java JRE – kiri Sep 19 '13 at 0:17
  • This is desktop environment specific, not flexible if JVM arguments need to be passed;-) But you are right anyway, double click executes jar files in DE/WM. – Terry Wang Sep 19 '13 at 0:21
  • WHat about self-extracting jar files? – terdon Sep 19 '13 at 0:21
0

Open a terminal with Ctrl+Alt+T, then type

chmod +x /path/to/jar_file.jar

If the check doesn't come up, it might be on a Windows filesystem, which wont work

| improve this answer | |
  • I have had it work on 12.04 before but not this time so I don't know what to do. – Ben Sep 19 '13 at 0:13
  • @Ben Is it on your system drive or a external disk? – kiri Sep 19 '13 at 0:14
0
  1. Simply press CTRL+ALT+T
  2. type:

    java -Xms1024M -Xmx1024M -jar (copy and paste path to minecraft.jar)/Minecraft.jar
    
  3. Enjoy

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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