LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   running a java application and running it from KDE menu (https://www.linuxquestions.org/questions/linux-newbie-8/running-a-java-application-and-running-it-from-kde-menu-4175626930/)

gerrysw11 04-03-2018 11:19 AM

running a java application and running it from KDE menu
 
I have a working java application

I have successfully created an item in my KDE menu but it won't run

details

Command: java -jar home/me/folder name/application.jar

Work path: /home/me/folder name (selected using choose folder)

I know

/home/me/folder name/>java -jar application.jar

works, but

/home/me>java -jar /"folder name"/application.jar

returns

Error: Unable to access jarfile /"folder name"/application.jar

I'm not sure if I have two problems or one

any help gratefully received

jsbjsb001 04-03-2018 11:51 AM

Have you tried the "Run in terminal" option?

gerrysw11 04-03-2018 12:21 PM

Thank you for replying, I'm sorry my post was unclear, I thought I'd said that

yes

from the command line, in the right directory

> java -jar application.jar works

it is when I try to get "clever" that I run into problems.

I'd like to be able to launch the application using an icon on my KDE desktop

jsbjsb001 04-03-2018 12:58 PM

Quote:

Originally Posted by gerrysw11 (Post 5838900)
Thank you for replying, I'm sorry my post was unclear, I thought I'd said that

yes

from the command line, in the right directory

> java -jar application.jar works

it is when I try to get "clever" that I run into problems.

I'd like to be able to launch the application using an icon on my KDE desktop

Well, I've just created a shortcut on my desktop to a java app on my machine. Apart from it complaining that it can't find it's "manifest file", it does seem to launch it up to that point.

Under the "Permissions" tab I have "Is executable" ticked. Under the "Application" tab;

I very much doubt it matters what you put into the "Description" field.
In the "Command" field I have "java -jar /home/my_username_here/java_app_name_here.jar"
I have nothing in the "Work path" field. I do have the option "Run in terminal" ticked, but I still get the same error at the command-line tho.

gerrysw11 04-03-2018 01:26 PM

I removed the space from the directory name "just in case" and edited the command line accordingly

the "is executable" radio button is checked

whether or not a work path is required I do not understand why the application doesn't launch

From the command line the .jar file will not launch

java -jar /directory/file.jar

but will launch from within the directory

directory/>java -jar file.jar

nothing works in the KDE menu entry

jsbjsb001 04-03-2018 01:35 PM

Quote:

Originally Posted by gerrysw11 (Post 5838922)
I removed the space from the directory name "just in case" and edited the command line accordingly

the "is executable" radio button is checked

whether or not a work path is required I do not understand why the application doesn't launch

From the command line the .jar file will not launch

java -jar /directory/file.jar

but will launch from within the directory

directory/>java -jar file.jar

nothing works in the KDE menu entry

Good you removed the space, as that would confuse the system and cause it not to find your app. If there is really a space in the folder name, you need to escape the "special meaning" by using a '\', so let's say that you have a folder called "my folder"; the path you would need would be (for example) "/home/my\ folder/". Sounds like that could be your problem or maybe a $PATH issue.

rbits 08-24-2023 03:07 AM

I know this thread is very old, but has anyone found a solution? I'm having the same problem


All times are GMT -5. The time now is 06:28 PM.