Page 2 of 2 FirstFirst 12
Results 11 to 17 of 17

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

  1. #11
    Join Date
    Aug 2011
    Beans
    322
    Distro
    Xubuntu 13.04 Raring Ringtail

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

    OK, I downloaded and unzipped krut. I am using the Oracle java and you obviously are using OpenJDK. When I run krut through Oracle java I have no problem. It opens and runs fine. It doesn't matter whether I have the system set up to use Oracle java runtime to run jar files or manually run the java runtime with the -jar option. So, I am wondering if it doesn't have something to do with OpenJDK. Do you have this problem with any other jar files? I also assume that you are set up to automatically run a jar file with the OpenJDK runtime if you double click the jar file as it appears you are. 'Tiz a puzzlement. If you are not having a similar problem with other jar files and there is nothing odd about your installation of OpenJDK, you might kick the problem up to both the krut programmers and to the OpenJDK folks. Don't be surprised if they both don't say CND (cannot duplicate) but it might be worth a try.

    ADDED: I went back and tried to run KRUT.jar from the command line. With the x bit unset I got 'permission denied' as expected and then with sudo I got a 'command not found' as expected. Then, setting the x bit, I got 'invalid file (bad magic number): Exec format error' both normally and with sudo, again as expected.
    Last edited by agillator; September 28th, 2012 at 02:47 AM.

  2. #12
    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
    OK, I downloaded and unzipped krut. I am using the Oracle java and you obviously are using OpenJDK. When I run krut through Oracle java I have no problem. It opens and runs fine. It doesn't matter whether I have the system set up to use Oracle java runtime to run jar files or manually run the java runtime with the -jar option. So, I am wondering if it doesn't have something to do with OpenJDK. Do you have this problem with any other jar files? I also assume that you are set up to automatically run a jar file with the OpenJDK runtime if you double click the jar file as it appears you are. 'Tiz a puzzlement. If you are not having a similar problem with other jar files and there is nothing odd about your installation of OpenJDK, you might kick the problem up to both the krut programmers and to the OpenJDK folks. Don't be surprised if they both don't say CND (cannot duplicate) but it might be worth a try.

    ADDED: I went back and tried to run KRUT.jar from the command line. With the x bit unset I got 'permission denied' as expected and then with sudo I got a 'command not found' as expected. Then, setting the x bit, I got 'invalid file (bad magic number): Exec format error' both normally and with sudo, again as expected.
    I've had similar results with other .jar files(SweetHome for one). Evidently, it must be an OpenJDK problem, I haven't been bothered to download java from oracle since I rarely use Java programs and don't want to fiddle with it. Maybe there is a bug report about this? I'll have to check.

    I'm not sure what you mean at the end- have you tried running JDK from the CLI without executable permissions set?
    Read my technology blog at: http://penguincampaigner.wordpress.com

  3. #13
    Join Date
    Aug 2011
    Beans
    322
    Distro
    Xubuntu 13.04 Raring Ringtail

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

    The last 'added' bit was just saying I had tried to run the file as if it were an actual runnable file, ignoring java itself, to see what would happen. Results were as expected.

  4. #14
    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
    The last 'added' bit was just saying I had tried to run the file as if it were an actual runnable file, ignoring java itself, to see what would happen. Results were as expected.
    Ah yes, I get it now.
    It seems OpenJDK wants jre's to be executable and not Oracle java. How strange... Well, people should mention what java their using- I assumed OP was using JDK, since that is what is included by default in Ubuntu.
    Read my technology blog at: http://penguincampaigner.wordpress.com

  5. #15
    Join Date
    Aug 2011
    Beans
    322
    Distro
    Xubuntu 13.04 Raring Ringtail

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

    I think you are right, but it makes no sense to me. A jar file a set of data files which has been compressed. It is never executed. The individual files in the jar file are never executed. That's why a java runtime is needed in the first place. But that is certainly above my pay grade. Since you use OpenJDK, though, it might be interesting to ask them.

  6. #16
    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 for all the comments, it's been interesting to follow.

    Am I right in thinking it's partly down to which Java package I have installed then?

  7. #17
    Join Date
    Aug 2011
    Beans
    322
    Distro
    Xubuntu 13.04 Raring Ringtail

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

    It appears so, although until this conversation I would not have thought so.

Page 2 of 2 FirstFirst 12

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
  •