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

Thread: How to get Java to not need root user to run web application?

  1. #1

    Default How to get Java to not need root user to run web application?

    I followed the instructions from here https://en.opensuse.org/SDB:Installing_Java to get Oracle java running because an application I need wouldn't run reliably with openjdk. Once I got it installed (/usr/java/jre1.8.0_152/) I had the problem that the app (a .jnlp file) would seem to start and then java would give an error:
    Unable to launch the application.

    After playing around with Java permissions with no change in result I thought I would try running the app. as the root user (using Dolphin in root user mode) and sure enough the app. started just fine.

    Clearly I should not need to be root user to run applications so does anyone have any idea what I would need to do to make these web Java apps. run as a normal user?

    Thanks!

  2. #2
    Join Date
    Jun 2008
    Location
    San Diego, Ca, USA
    Posts
    11,462
    Blog Entries
    2

    Default Re: How to get Java to not need root user to run web application?

    That's probably because your java application files are in a location that requires root permissions.

    Place your app files in something like ~/Documents and then try invoking.

    If that doesn't work,
    Then you'll have to provide details about the web application and the file location.

    TSU
    Beginner Wiki Quickstart - https://en.opensuse.org/User:Tsu2/Quickstart_Wiki
    Solved a problem recently? Create a wiki page for future personal reference!
    Learn something new?
    Attended a computing event?
    Post and Share!

  3. #3

    Default Re: How to get Java to not need root user to run web application?

    Quote Originally Posted by tsu2 View Post
    That's probably because your java application files are in a location that requires root permissions.

    Place your app files in something like ~/Documents and then try invoking.

    If that doesn't work,
    Then you'll have to provide details about the web application and the file location.

    TSU
    The app. was originally in the temp. dir. that FireFox downloaded it. As a test I moved it to ~/Downloads, made sure its owner was me, which it was anyway, and then tried to run it. I had the same error. The application is AdvancedPlanner.jnlp from https://projectplanning.cloud/RationalPlan .

    It starts up fine from my Windows laptop from FireFox and it started fine before I installed and made Oracle's Java the default in my Leap computer (it just didn't run reliably).

  4. #4
    Join Date
    Jun 2008
    Location
    San Diego, Ca, USA
    Posts
    11,462
    Blog Entries
    2

    Default Re: How to get Java to not need root user to run web application?

    Quote Originally Posted by Reg_gie View Post
    The app. was originally in the temp. dir. that FireFox downloaded it. As a test I moved it to ~/Downloads, made sure its owner was me, which it was anyway, and then tried to run it. I had the same error. The application is AdvancedPlanner.jnlp from https://projectplanning.cloud/RationalPlan .

    It starts up fine from my Windows laptop from FireFox and it started fine before I installed and made Oracle's Java the default in my Leap computer (it just didn't run reliably).
    Need complete details...
    Download from wherever.
    command you're running to invoke.
    And, possibly (but maybe not necessary) any references and/or documentation you're following.

    BTW - following says should be invoked with a sh script and not a java command. If you really wanted to invoke using a java command, it's probably in the script
    https://www.rationalplan.com/tutoria...02.html#d0e181

    TSU
    Beginner Wiki Quickstart - https://en.opensuse.org/User:Tsu2/Quickstart_Wiki
    Solved a problem recently? Create a wiki page for future personal reference!
    Learn something new?
    Attended a computing event?
    Post and Share!

  5. #5

    Default Re: How to get Java to not need root user to run web application?

    Quote Originally Posted by tsu2 View Post
    Need complete details...
    Download from wherever.
    command you're running to invoke.
    And, possibly (but maybe not necessary) any references and/or documentation you're following.

    BTW - following says should be invoked with a sh script and not a java command. If you really wanted to invoke using a java command, it's probably in the script
    https://www.rationalplan.com/tutoria...02.html#d0e181

    TSU
    I think I have given you complete details on what I did:

    • I setup Java according to: https://en.opensuse.org/SDB:Installing_Java
    • I setup the the Java version: jre1.8.0_152 and Java installed itself at: /usr/java/jre1.8.0_152/
    • I downloaded the app from: https://projectplanning.cloud/RationalPlan (you probably won't be able to do so without an account with them)
    • Invoked it by clicking on the downloaded file through Dolphin and before that just tried to launch it through the browser which is the normal way. It's started with javaws which is Java Web Start as far as I know, I am not an expert on Java by any means.


    All of the above is already in the previous posts and there isn't anything else to tell that I know of but by all means feel free to ask for more information if I have left something out.

  6. #6
    Join Date
    Jun 2008
    Location
    Groningen, Netherlands
    Posts
    20,039
    Blog Entries
    14

    Default Re: How to get Java to not need root user to run web application?

    what happens if you do start it as root and then try to access the app in a browser ?
    ° Appreciate my reply? Click the star and let me know why.

    ° Perfection is not gonna happen. No way.

    https://en.opensuse.org/openSUSE:Board#Members
    http://en.opensuse.org/User:Knurpht
    http://nl.opensuse.org/Gebruiker:Knurpht

  7. #7
    Join Date
    Jun 2008
    Location
    San Diego, Ca, USA
    Posts
    11,462
    Blog Entries
    2

    Default Re: How to get Java to not need root user to run web application?

    Quote Originally Posted by Reg_gie View Post
    I think I have given you complete details on what I did:

    • I setup Java according to: https://en.opensuse.org/SDB:Installing_Java
    • I setup the the Java version: jre1.8.0_152 and Java installed itself at: /usr/java/jre1.8.0_152/
    • I downloaded the app from: https://projectplanning.cloud/RationalPlan (you probably won't be able to do so without an account with them)
    • Invoked it by clicking on the downloaded file through Dolphin and before that just tried to launch it through the browser which is the normal way. It's started with javaws which is Java Web Start as far as I know, I am not an expert on Java by any means.


    All of the above is already in the previous posts and there isn't anything else to tell that I know of but by all means feel free to ask for more information if I have left something out.
    I'll take a few minutes and look at this, but your "Download" link doesn't point to a download page or a file... It points to the cloud login page.
    Would also be useful if you can provide the <exact> file name you downloaded (It's probably a zip file that needs to be unpacked).

    And FYI -
    Generally, if you really did try to "run" a java app, double-clicking in Dolphin(or any other graphical file manager) won't execute the file properly.

    TSU
    Beginner Wiki Quickstart - https://en.opensuse.org/User:Tsu2/Quickstart_Wiki
    Solved a problem recently? Create a wiki page for future personal reference!
    Learn something new?
    Attended a computing event?
    Post and Share!

  8. #8

    Default Re: How to get Java to not need root user to run web application?

    Quote Originally Posted by Knurpht View Post
    what happens if you do start it as root and then try to access the app in a browser ?
    I don't quite understand the question. When I start it normally as the root user it is a Java application independent of the browser, I'm not sure what going to the browser at this point achieves?

  9. #9

    Default Re: How to get Java to not need root user to run web application?

    Quote Originally Posted by tsu2 View Post
    I'll take a few minutes and look at this, but your "Download" link doesn't point to a download page or a file... It points to the cloud login page.
    Would also be useful if you can provide the <exact> file name you downloaded (It's probably a zip file that needs to be unpacked).
    The reason I can't give you an exact link is because the link is only accessible by logging into our account. The accounts are free (for 30 days) and you can create one in minutes but I can't give you our link, I don't have the authorization to make it public and if I did it would be useless without the login information. This is why I gave the general link, it was the best I could do. Here is the downloaded file though:
    Code:
    :~> ls -al Downloads/AdvancedPlanner.jnlp
    -rwxr--r-- 1 reg users 2970 Nov  7 01:18 Downloads/AdvancedPlanner.jnlp*
    And FYI -
    Generally, if you really did try to "run" a java app, double-clicking in Dolphin(or any other graphical file manager) won't execute the file properly.
    TSU
    I don't know what to say about this, I guess I just got lucky that it would start by the root user at least.

  10. #10
    Join Date
    Feb 2010
    Location
    Germany
    Posts
    2,594

    Question Re: How to get Java to not need root user to run web application?

    @Reg_gie:
    Is it a correct assumption that, you're attempting to run an "Advanced Planning and Scheduling" Java application (possibly from 'IBM Rational') which absolutely needs Oracle Java to execute correctly?

    Which begs the question: is it really a "Web Application" or, is it a Java application which accesses resources via the Internet?

    The reason I'm asking is, I use a Java HBCI application which has run perfectly for years without any "need to use root" issues -- despite a phase where, the Java code wasn't so happy with OpenJDK and I had to use Oracle Java to work around the issue but, that's past history -- the application has been running quite happily for the past few years with OpenJDK.


    Another Java application I have, which was used for maintenance of an ISDN telephone switch (since the change to VoIP, it's been retired), had to be executed from the user "root" because, it used a USB cable with a private protocol to access the ISDN hardware -- no big issue -- and, actually, perfectly normal within the telecommunications industry.

Page 1 of 2 12 LastLast

Posting Permissions

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