LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 04-03-2018, 11:19 AM   #1
gerrysw11
LQ Newbie
 
Registered: Apr 2018
Posts: 3

Rep: Reputation: Disabled
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
 
Old 04-03-2018, 11:51 AM   #2
jsbjsb001
Senior Member
 
Registered: Mar 2009
Location: Earth, unfortunately...
Distribution: Currently: OpenMandriva. Previously: openSUSE, PCLinuxOS, CentOS, among others over the years.
Posts: 3,881

Rep: Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063
Have you tried the "Run in terminal" option?

Last edited by jsbjsb001; 04-03-2018 at 12:18 PM. Reason: correction
 
Old 04-03-2018, 12:21 PM   #3
gerrysw11
LQ Newbie
 
Registered: Apr 2018
Posts: 3

Original Poster
Rep: Reputation: Disabled
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
 
Old 04-03-2018, 12:58 PM   #4
jsbjsb001
Senior Member
 
Registered: Mar 2009
Location: Earth, unfortunately...
Distribution: Currently: OpenMandriva. Previously: openSUSE, PCLinuxOS, CentOS, among others over the years.
Posts: 3,881

Rep: Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063
Quote:
Originally Posted by gerrysw11 View Post
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.
 
Old 04-03-2018, 01:26 PM   #5
gerrysw11
LQ Newbie
 
Registered: Apr 2018
Posts: 3

Original Poster
Rep: Reputation: Disabled
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
 
Old 04-03-2018, 01:35 PM   #6
jsbjsb001
Senior Member
 
Registered: Mar 2009
Location: Earth, unfortunately...
Distribution: Currently: OpenMandriva. Previously: openSUSE, PCLinuxOS, CentOS, among others over the years.
Posts: 3,881

Rep: Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063
Quote:
Originally Posted by gerrysw11 View Post
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.

Last edited by jsbjsb001; 04-03-2018 at 01:37 PM.
 
Old 08-24-2023, 03:07 AM   #7
rbits
LQ Newbie
 
Registered: Aug 2023
Posts: 1

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


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
A java application running at runlevel 3 MRMadhav Programming 5 04-20-2011 03:07 PM
Running Java Application with no desktop environment. cslucsm Linux - Newbie 4 09-14-2010 08:45 AM
Running Java Application with no desktop environment. cslucsm Linux - General 3 09-10-2010 12:45 PM
Running java application in linux using xming/cygwin Shefali Jain Linux - Newbie 1 09-25-2009 09:14 AM
error running java application alee Linux - Newbie 2 02-09-2009 12:29 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 06:20 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration