Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Here is the problems, I have a jar programme, which help me to do something amazing... I run it on terminal like this:

jar /application/amazing.jar

It runs, but it seems that take my terminal to another environment, if I use the up arrow key to find the last commend I type in the java application, I can't find it back.

share|improve this question

closed as not a real question by iglvzx, Ƭᴇcʜιᴇ007, Diogo, Joe Taylor, ChrisF Jul 13 '12 at 22:53

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

    
So you mean WHILE the program is running you can not use the arrow key functionality? In that case the functionality must be provided by the java program. If it doesn't either request them to add the feature - or try a workaround yourself... –  bdecaf Mar 15 '12 at 8:15

2 Answers 2

I would expect the command is really java /application/amazing.jar as jar is the command to maintain jar files not execute them. If you really use jar to run the file, use the second option and replace java with `jar.

Just run the command chmod +x /application/amazing.jar once. This will make the jar executable. After that you should be able to run the jar using the command /application/amazing.jar or amazing.jar if /application is included in your path.

An alternative approach is to write a short script to run your jar. For example /usr/local/bin/amazing which would be run using the command amazing could contain:

#!/usr/bin/bash
java /application/amazing.jar

The first approach is simpler, but can not do any setup required before running the jar. The second approach can handle setup required before the jar is run. Just add the setup before the jar command. They can be combined and the java command could be removed from the script.

share|improve this answer

jarwrapper

sudo apt-get install jarwrapper

Run executable Java .jar files

Jarwrapper sets up binfmt-misc to run executable jar files using the installed java runtime.

It also includes a /usr/share/jarwrapper/java-arch.sh script to convert Debian architecture names into java names to locate libjvm.so

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.