Linux Help
guides forums blogs
Home Desktops Distributions ISO Images Logos Newbies Reviews Software Support & Resources Linuxhelp Wiki

Welcome Guest ( Log In | Register )

Advanced DNS Management
New ZoneEdit. New Managment.


Sign Up Now
Reply to this topicStart new topic
> Help getting program to run as root in shortcut, Java program
post Jul 22 2006, 09:57 PM
Post #1

Whats this Lie-nix Thing?

Group: Members
Posts: 1
Joined: 22-July 06
Member No.: 6,819

I can't seem to figure out how to get my .jar program to run as root. I know root is bad, but I need to run it as root all the time. I want to create a shortcut to do this for me, but I can't figure out. I think it has something to do with sudo, but I have no idea where to begin.


Btw, I'm using Ubuntu (You can't log in as root, only sudo)
Go to the top of the page
+Quote Post
post Jul 23 2006, 04:07 AM
Post #2


Group: Support Specialist
Posts: 84
Joined: 18-June 06
Member No.: 6,568

First open up a terminal and then log as root using this

Then enter the root password..and then you can run the jar files using
java -jar <my_program.jar>

If you want a shortcut i think you will need a shell any text editor and then type this
su -c "java -jar <my_program.jar>"

then save this file as link this file to /bin or /usr/bin with
chmod +x <path to the .sh file>
ln -s <full path to the sh file> /bin/myprog

Now you can invoke your java program using the shortcut

-- a *certified* n00b

"The best is Yet to come !"

My Desktop : OpenSuSE 10.1 | FVWM-Crystal | MPD | Gaim | Opera | Mrxvt
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:


RSS Lo-Fi Version Time is now: 24th June 2018 - 11:37 AM