Icon Launcher + .jar file

sktsee sktsee at tulsaconnect.com
Fri Jul 6 20:05:46 UTC 2007


On Fri, 2007-07-06 at 11:49 -0700, NoOp wrote: 
> On 07/06/2007 09:45 AM, Derek Broughton wrote:
> > Dom Incollingo wrote:
> > 
> >> To the best of my knowledge, you cannot execute a jar the same way
> >> that you would execute a script or an executable program.  You
> >> normally execute a jar file using the -jar option of the java
> >> program.  For example:
> >> 
> >> java  -jar  <jar name>
> >> 
> >> Or in your case,
> >> 
> >> cd  /home/gg/javascore/ java  -jar  JavaScore.jar
> >> 
> > 
> > I'll bite.  Is Gnome really so primitive as to not be able to work
> > that out? As far as _Linux_ is concerned, a jar is just as executable
> > as a script.
> 
> You know actually now that you mention it, I think that it should. I'm
> wondering if perhaps there is something wrong with the mime type and/or
> gnome-mime-database. I checked the permissions for the jar Javascore.jar
> file and it is registered as 'application/x-java-archive' and set to
> allow executing as a program. And in /usr/share/mime/globs I do show:
> application/x-java-archive:*.jar so I'm not sure what the problem is at
> this point.
> 
> 
If you were to create the launcher as a "File" type instead of an
"Application" type, it would work with out having to prefix "java -jar"
to the path. This method will use the same mechanism that Nautilus uses
to handle the jar file - a lookup in the mime-database and then, I'd
guess, and exec to the appropriate app (java) that handles the file's
mime type.

Also note that trying to execute the jar file in a shell (just the file,
no "java -jar" in front) won't work unless you register an interpreter
with the kernel to handle it. Man update-binfmts for more info.

-- 
sktsee





More information about the ubuntu-users mailing list