Results 1 to 10 of 10

Thread: Unable to execute a .jar file in Ubuntu

  1. #1
    Join Date
    Apr 2015
    Beans
    5

    Question Unable to execute a .jar file in Ubuntu

    Technicfailure.jpg

    Hello, I am new to Ubuntu. I have installed oracle java 7 and 8 runtime. I am unable to get this jar file to respond at all, and i cannot double click it.
    I have marked it in the properties to allow executing as a program.

    java -version gives me
    java version "1.8.0_40"
    Java(TM) SE Runtime Environment (build 1.8.0_40-b26)
    Java HotSpot(TM) Server VM (build 25.40-b25, mixed mode)


    I am sure i am making some new user mistake, please help me determine what it is so that I can learn for the future :]

  2. #2
    Join Date
    May 2007
    Location
    Virginia, USA
    Beans
    13,377
    Distro
    Ubuntu Mate Development Release

    Re: Unable to execute a .jar file in Ubuntu

    Have you tried doing "java -jar <filename>"? I have jar files and that's how they get run.
    Ubuntu 20.04, Mint 19.10; MS Win10 Pro.
    Will not respond to PM requests for support -- use the forums.

  3. #3
    Join Date
    Apr 2015
    Beans
    5

    Re: Unable to execute a .jar file in Ubuntu

    Quote Originally Posted by Mark Phelps View Post
    Have you tried doing "java -jar <filename>"? I have jar files and that's how they get run.
    Yes, I have. The image I enclosed is the result of "java -jar TechnicLauncher.jar".

  4. #4
    Join Date
    May 2007
    Location
    Virginia, USA
    Beans
    13,377
    Distro
    Ubuntu Mate Development Release

    Re: Unable to execute a .jar file in Ubuntu

    I use the OpenJDK runtime v1.7.0_79 in Ubuntu 15.04 and jar files open just fine.

    Don't use Oracle java, so can't offer any suggestions.
    Ubuntu 20.04, Mint 19.10; MS Win10 Pro.
    Will not respond to PM requests for support -- use the forums.

  5. #5
    Join Date
    Apr 2015
    Beans
    5

    Re: Unable to execute a .jar file in Ubuntu

    Maybe this will help-

    To clarify, I can open other .jar files without a problem. I can double click Minecraft.jar, and it runs without fail. It's just this other .jar file that seems to be giving me the trouble, but it's the latest release from technicpack.net, so I am pretty sure the error is on my end somehow.

  6. #6
    Join Date
    Nov 2008
    Location
    S.H.I.E.L.D. 6-1-6
    Beans
    Hidden!
    Distro
    Ubuntu Development Release

    Re: Unable to execute a .jar file in Ubuntu

    Try
    Code:
    sudo apt-get install libxi6
    Don't waste your energy trying to change opinions ... Do your thing, and don't care if they like it.

  7. #7
    Join Date
    Apr 2015
    Beans
    5

    Re: Unable to execute a .jar file in Ubuntu

    I just did that, it says libxi6 is already the newest version; it did however recommend i do "apt-get autoremove" which i did.

  8. #8
    Join Date
    Aug 2014
    Beans
    Hidden!
    Distro
    Ubuntu 16.04 Xenial Xerus

    Re: Unable to execute a .jar file in Ubuntu

    I downloaded the TechnicLauncher.jar file from http://www.technicpack.net/download
    It will open here via terminal with "java -jar TechnicLauncher.jar" or right click and open with "Oracle java runtime"

    I noticed your pick in post #1 seemed to indicate it couldn't find a 32bit link ie unsatisfiedlinkerror /home/me/lib/i386/lib...

    I am running Ubuntu 14.04 64bit with java-8-oracle set as default java. INSTALL ORACLE JAVA 8 IN UBUNTU
    What do these commands give you?
    Code:
    lsb_release -a
    uname -a
    sudo update-alternatives --config java
    eg my output...
    Code:
    glen@Trusty:~$ lsb_release -a
    LSB Version:	security-4.0-amd64:security-4.0-noarch:security-4.1-amd64:security-4.1-noarch
    Distributor ID:	Ubuntu
    Description:	Ubuntu 14.04.2 LTS
    Release:	14.04
    Codename:	trusty
    
    glen@Trusty:~$ uname  -a
    Linux Trusty 3.16.0-34-generic #47~14.04.1-Ubuntu SMP Fri Apr 10 17:49:16 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
    
    glen@Trusty:~$ sudo update-alternatives --config java
    [sudo] password for glen: 
    There are 3 choices for the alternative java (providing /usr/bin/java).
    
      Selection    Path                                            Priority   Status
    ------------------------------------------------------------
      0            /usr/lib/jvm/java-6-oracle/jre/bin/java          1079      auto mode
      1            /usr/lib/jvm/java-6-oracle/jre/bin/java          1079      manual mode
      2            /usr/lib/jvm/java-7-openjdk-amd64/jre/bin/java   1071      manual mode
    * 3            /usr/lib/jvm/java-8-oracle/jre/bin/java          1078      manual mode
    
    Press enter to keep the current choice[*], or type selection number:
    All works here.
    The java app sets a default directory, downloads some files then presents a login window.
    Attached Images Attached Images
    Last edited by CantankRus; April 27th, 2015 at 03:27 PM.

  9. #9
    Join Date
    Apr 2015
    Beans
    5

    Re: Unable to execute a .jar file in Ubuntu

    java config.png

    Here is the results of what you requested; it seems I didn't have LSB, which after checking the repository, is Linux Standard Base, so i installed just now.

    After getting the same error message attempting to run the launcher from terminal, i had the earth-shattering idea to, instead of "java -jar TechnicLauncher.jar", to try "sudo java -jar TechnicLauncher.jar".

    It worked.

    The error message seemed to be either telling me the file wasn't there or I didn't have permissions, solved by using sudo. Wow.

    Thank you so much for the help!

  10. #10
    Join Date
    Aug 2014
    Beans
    Hidden!
    Distro
    Ubuntu 16.04 Xenial Xerus

    Re: Unable to execute a .jar file in Ubuntu

    Shouldn't need sudo and not sure if it's even wise to use with a java app that connects to the net and downloads.
    I would be checking permissions of my files and folders.
    I don't have lsb installed but do have lsb_release installed by default.

    Main difference I can see is you have java-7-oracle set as default java where I have java-8-oracle.
    Last edited by CantankRus; April 27th, 2015 at 02:22 PM.

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
  •