How to add Java applications to panel
Hi,
I have some Java applications written by myself and would like to place executable buttons in the graphical Desktop panel. For instance, I have my jar file, then I have another file "MyExecutable" that has the command java -jar myfile.jar, which I have made "executable", i.e. if I double click on it, ubuntu asks me if I want to run the program or show its contents. I'd like to have a button in the gnome panel I could start the program with; when I configure the custom launcher dialog, I do not know what to insert in the "command" field (/home/Desktop//.MyExectuable does not work). Thanks for your help. |
Code:
/home/Desktop/MyExecutable EDIT: you launch it like "./MyExecutable" from the terminal if your working directory is the directory where the executable is, because the dot file "." means the current directory. Therefore "./" means "inside the current directory", and "./MyExecutable" means "run MyExecutable from within this current directory". You can also run it with full path, like "/home/username/Desktop/MyExecutable", which is what you use with the launcher, because the launcher's "current working directory" isn't necessarily what you want, if it even is aware about such a thing. |
Quote:
Code:
/home/myname/Desktop/MyExecutable This is how I created the "MyExecutable": with gedit in a new file, added "java -jar MyJavaApp.jar". Wrote to disk with no extension. With gnome, under "permissions", I changed it to executable. Gnome however still recognizes this of type "plain text document". |
Try entering the commands as
Code:
java -jar /path/to/myfile.jar |
Quote:
|
Quote:
|
Quote:
Thx! :) |
Quote:
Code:
jarloader /path/to/program.jar Code:
cat > /usr/local/bin/jarloader << EOF Let’s make it executable: Code:
chmod +x /usr/local/bin/jarloader Code:
modprobe binfmt_misc Code:
mount -t binfmt_misc none /proc/sys/fs/binfmt_misc Code:
echo ":JAR:E::jar::/usr/local/bin/jarloader:" > /proc/sys/fs/binfmt_misc/register Code:
cat /proc/sys/fs/binfmt_misc/JAR Code:
echo "0" > /proc/sys/fs/binfmt_misc/JAR Code:
echo "1" > /proc/sys/fs/binfmt_misc/JAR Code:
echo "-1" > /proc/sys/fs/binfmt_misc/JAR
|
All times are GMT -5. The time now is 06:51 PM. |