Link to home
Start Free TrialLog in
Avatar of ostraaten
ostraaten

asked on

How to run Java/Eclipse jar without sudo on Ubuntu

I'm trying to run a Eclipse jar on Ubuntu. This jar is a command line utility part of Eclipse Process Framework that allows to publish from the command line rather than the IDE, for integrating in a build process/automating.

The command is
java -jar /home/ostraaten/Apps/epfc_1.5.0.1/plugins/org.eclipse.equinox.launcher_1.0.1.R33x_v20080118.jar -data /ostraaten/EPF/workspace.150 -nosplash -application org.eclipse.epf.publishing.cmdline.Publish -libraryPath /home/ostraaten/Apps/epfc_1.5.0.1/epf_practices/ -publishPath /home/ostraaten/EPF/Publish/openup -config publish.openup -os linux -arch x86 -ws gtk

The above command does very little when I run like that. It does not execute or try to execute the publish procedure. There is no error. The command returns very quickly. When I add -verbose I see that it loads a bunch of stuff but does not execute anything.

When I add sudo to the command the command line works as expected. But of course I don't want to use sudo: all generated content will be owned by root and this also defeats the purpose of having the command line, If it prompts for a password, there is no use in making it part of the build process. Note: I can run the publish from the IDE (without the command line), no problems.

The issue is not Eclipse or Ubuntu related I think. This is an issue with Java that Sun created. At least that is my hunch. I know of one person who managed to get it working without sudo on Ubuntu, I think same version as me. So it is possible.

I searched using Google but found very little info on this issue. Now I would really appreciate some pointers on how to fix this and tackle this problem.
ASKER CERTIFIED SOLUTION
Avatar of cdittberner
cdittberner
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of ostraaten
ostraaten

ASKER

Wow!!! That is it. Don't understand I didn't see that problem with the command line sooner.

Don't understand that it works with sudo but anyway I'm happy. Thanks!
Using the -data option you have specified a new workspace directory which is automatically created during startup if it doesn't exist. Only root has the permissions to create something in "/" and it is created only with root-rwx-permissions. And so your first run created the "/ostraaten/EPF/workspace.150"-dir with permissions 700.