Jump to content

KDE File Associations and Java


sherington
 Share

Recommended Posts

Hi,

 

This is driving me mad. I've googled and still can't get any further.

 

I want to be able to create a file-type association for Java .jar files so that I can execute a jar file simply by clicking on it in the desktop (specifically KDE). In addition, I don't want a terminal window to appear.

 

I know where to go to edit file associations in Konqueror settings, but I'm struggling with configuring the execution string.

 

To launch a jar file, I normally do this in konsole:

 

/home/java/jre/bin/java -jar nameofjarfile.jar

 

So presumably I need to do something like:

 

/home/java/jre/bin/java -jar <some-special-token-to-substitute-the-file-name>

 

The problem is I can't find an explanation of what substitution token I'm supposed to use anywhere! %c, %U %m, what?

 

Any help will be appreciated, thanks!

Link to comment
Share on other sites

quick fix:

 

first make a link :

create a directory named bin on your home directory then type something like:

 

ln -s /home/java/jre/bin/java /home/bin/java

 

then:

 

click right on your .jar file and open with ...

 

write in the top drop down box : java -jar

 

and click on the check box on the bottom of the screen where it says remember this file association (or something similar)

 

hopes this help :)

Edited by !nkubus
Link to comment
Share on other sites

  • 2 weeks later...

Thanks Inkubus.

 

(I already had the symlink in place.)

 

Your suggestion worked perfectly, i.e. just put "java -jar" in there.

 

I suppose I was guilty of trying to over-complicate things. I presumed I'd need to use a file-name substitution token or something in the execute string, like %f %m %n or whatever. I still haven't found any information on what those tokens are, but at least now I can launch my Java applications very easily now.

 

Thanks for your help.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...