I know I should know this. I have just downloaded a java .jar application and it is sitting in my Downloads directory with permissions
I can run it as root from the Downloads directory but what is the correct way to run it as me and the correct directory in which to put such programs. How can I run a downloaded java application as me, a user, and not as root? Is it just changing permissions or should I change ownership? Should the .jar file be an executable as well? Can a java file be an executable?
Sorry to ask such basic questions but I need to get these thinks right and have fudged it till now!!!
When you have downloaded it in your GUI, you will be the owner. And you are able to run it. Of course root can run it (if it is runable at all), but why would you try that or even want to try that. It is you, the normal user that downloaded it. Did you try to run it (because you do not say so)?
Show us an
of the file.
I know you showed some misshapen part of that, but why not the whole line?
What DE are you using, I believe kde and gnome have propper mime settings for jar files but seeing how jar’s are regular zip’s some archiver’s might take over jar handling. In dolphin when you right-click on a jar do you have an option open with java?
In principle jar’s can be run from the command line
had a similar issue today
it seams ark takes over jar files handling,
a quick fix:
In open with → other
type java -jar
check remember application…
now there’s an option to run jar files in a java virtual machine
if you’d like to make this more permanent and have all jar’s open with a java virtual machine
see kde’s Configure Desktop → File Assosiation
to get the right dir, if you get a not defined error or no directory then it’s java’s default ext dir and that depends on the version of java you have installed, on the default openJDK 1.8 that dir would be /usr/lib/jvm/java-1.8.0-openjdk-1.8.0/jre/lib/ext/
you should note that you can change that dir eather by defining the $CLASSPATH variable or using the -cp switch