This subject maybe consider a very basic task, but statistic on the next surprise me on how many person query about this issue. So, we have a java .jar file, a file normally we download from internet as an application created by Java developer. Next question is how to run this application.
Do we have java installed already ?
To run all application created with Java, we will need Java runtime to run it. This is imperative regardless what operating system and whatever hardware we use. Java also have so many variant, sometime it is very confusing to choose we Java actually we need to install.
To obtain Java, we can navigate our browser to http://www.java.com/download and the rest is just click our mouse following instruction.
What is .jar file
JAR stands for Java Archive. It is an archive file format typically used to aggregate java class file and associate metadata and resources into one file to distribute application or software library on Java platform (source: Wikipedia).
JAR file built on the zip file format and has .jar extension. Computer users can create or extract jar file using jar command that bundled in Java Development Kit
Open .jar file
Jar file can be opened on most operating system typically just by double click on respective file, it is same like opening any document file that associated already with a specific application, in this case .jar file will be associated with java executable program.
Another way to run a java file is by using command line. This way will come in handy if we would like to save this on batch or script file and use it later for another purpose. Command to run .jar file is:
java –jar pathToJarFile
java –jar /users/ariefdarmawan/ChartNexus/chartnexus.jar
to open chartnexus file located on /users/ariefdarmawan/ChartNexus folder.