Page 1 of 2 12 LastLast
Results 1 to 10 of 17

Thread: Can't work out how to run .jar file directly from USB music player in Ubuntu 12.04

  1. #1
    Join Date
    Sep 2012
    Beans
    3

    Can't work out how to run .jar file directly from USB music player in Ubuntu 12.04

    Hi,

    It's probably a simple fix, but since moving to 12.04, I can't work out simple shortcuts to home folders from media/disk, that I can navigate to easily from the Terminal. I want to run NW-E00X_MP3_File_Manager-0.17a.jar which is an open source program to copy and manage music on an old Sony USB mp3 player.It needs to be an executable to run, or run from Terminal using SUDO I guess, but can't either select executable through the GUI or navigate to media through Terminal, nor set up a shortcut to media within the home or desktop folders.


    Should I run Nautilus with super user/root privileges and set-up a link or can i make the file executable through this route?


    Any thoughts?

    Cheers!

  2. #2
    Join Date
    Apr 2011
    Location
    Maryland
    Beans
    1,461
    Distro
    Kubuntu 12.04 Precise Pangolin

    Re: Can't work out how to run .jar file directly from USB music player in Ubuntu 12.

    I'm not sure I entirely followed what you want. It sounds like you simply want to make the .jar file executable. If that's the case, you can either right click on the file and from the properties menu check the box that says make executable. Or, from the terminal, just navigate to the file's location and run:

    Code:
    chmod +x NW-E00X_MP3_File_Manager-0.17a.jar
    Depending on where you downloaded it, you may need root privileges to do this, but I'm guessing that's probably not going to be the case.

    Then to run the file, you can (from the terminal), run:

    Code:
    java -jar /path/to/file/NW-E00X_MP3_File_Manager-0.17a.jar
    And it should run. I'm not sure how the java script works. Post back any errors you get, or I totally misunderstood what you're after, and we'll sort it out from there.

  3. #3
    Join Date
    Aug 2011
    Beans
    348
    Distro
    Xubuntu 14.04 Trusty Tahr

    Re: Can't work out how to run .jar file directly from USB music player in Ubuntu 12.

    I believe you do not need to make the file executable. A jar file is actually a data file for the java program - that's what needs to be executable. The command above is the correct command to run that jar file. You can set up a desktop launcher to run it also by entering that command in the command box of the launcher setup.

  4. #4
    Join Date
    Apr 2011
    Location
    Maryland
    Beans
    1,461
    Distro
    Kubuntu 12.04 Precise Pangolin

    Re: Can't work out how to run .jar file directly from USB music player in Ubuntu 12.

    I thought that might be the case. I don't remember ever making a .jar file executable. Thanks for the clarification!

  5. #5
    Join Date
    Sep 2012
    Beans
    3

    Re: Can't work out how to run .jar file directly from USB music player in Ubuntu 12.

    Thanks drmrgd

    The problem is it won't let me make the file executable by clicking in properties (it unchecks the box immediately) or navigate to any root folder on terminal, only the home directory.

    This wasn't a problem in 11, but since going to 12.04 it seems to be different on root privileges.

  6. #6
    Join Date
    Dec 2011
    Location
    Manchester, UK
    Beans
    356
    Distro
    Ubuntu

    Re: Can't work out how to run .jar file directly from USB music player in Ubuntu 12.

    Quote Originally Posted by niccolo View Post
    Thanks drmrgd

    The problem is it won't let me make the file executable by clicking in properties (it unchecks the box immediately) or navigate to any root folder on terminal, only the home directory.

    This wasn't a problem in 11, but since going to 12.04 it seems to be different on root privileges.
    If you can't navigate to a root folder in the terminal, you need to make yourself root, run;
    Code:
    sudo -i
    to open a root shell. If you STILL can't navigate to root owned folders, then you may have a permission problem on your hands.
    Read my technology blog at: http://penguincampaigner.wordpress.com

  7. #7
    Join Date
    Aug 2011
    Beans
    348
    Distro
    Xubuntu 14.04 Trusty Tahr

    Re: Can't work out how to run .jar file directly from USB music player in Ubuntu 12.

    If you are trying to make a jar file executable, don't worry about it. The jar file need not be, and probably shouldn't be, executable. It is only a data file. Actually it is a special compressed file (zip format, I believe) to be accessed by java itself. That's all it is and all it needs to be. When you run java, the -jar option tells it to use the named jar file and java takes it from there. If java complains of permission problems then that is a different story. The permission(s) at fault are NOT the executables, but the read permission(s).

  8. #8
    Join Date
    Dec 2011
    Location
    Manchester, UK
    Beans
    356
    Distro
    Ubuntu

    Re: Can't work out how to run .jar file directly from USB music player in Ubuntu 12.

    Quote Originally Posted by agillator View Post
    If you are trying to make a jar file executable, don't worry about it. The jar file need not be, and probably shouldn't be, executable. It is only a data file. Actually it is a special compressed file (zip format, I believe) to be accessed by java itself. That's all it is and all it needs to be. When you run java, the -jar option tells it to use the named jar file and java takes it from there. If java complains of permission problems then that is a different story. The permission(s) at fault are NOT the executables, but the read permission(s).
    I don't know... I've had some programs that do ask to be executable. Krut for example, doesn't run if it isn't made executable.
    Read my technology blog at: http://penguincampaigner.wordpress.com

  9. #9
    Join Date
    Aug 2011
    Beans
    348
    Distro
    Xubuntu 14.04 Trusty Tahr

    Re: Can't work out how to run .jar file directly from USB music player in Ubuntu 12.

    More than a little interesting. I have never had a jar file need to be executable. I am not aware of Krut, so I went to its site and from the instructions, limited though they are, it certainly appears they think the jar file itself doesn't need to be executable. Are you sure it is the jar file that needs to be executable, or could it be something else such as java itself or a directory that needs the executable bit set so you or the program can get into it, or something else? I'm certainly not saying you are wrong, just that this is something I have never seen before.

  10. #10
    Join Date
    Dec 2011
    Location
    Manchester, UK
    Beans
    356
    Distro
    Ubuntu

    Re: Can't work out how to run .jar file directly from USB music player in Ubuntu 12.

    Quote Originally Posted by agillator View Post
    More than a little interesting. I have never had a jar file need to be executable. I am not aware of Krut, so I went to its site and from the instructions, limited though they are, it certainly appears they think the jar file itself doesn't need to be executable. Are you sure it is the jar file that needs to be executable, or could it be something else such as java itself or a directory that needs the executable bit set so you or the program can get into it, or something else? I'm certainly not saying you are wrong, just that this is something I have never seen before.
    Code:
    The file '/home/<snip-username>/Software/Ubuntu-BB Linux Package/KRUT.jar' is not marked as executable.  If this was downloaded or copied from an untrusted source, it may be dangerous to run.  For more details, read about the executable bit.
    That's what I get when I try opening it with OpenJDK Java Runtime. It works fine when it is executable. Try running "Krut.jar" yourself without making it executable.
    Read my technology blog at: http://penguincampaigner.wordpress.com

Page 1 of 2 12 LastLast

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •