Results 1 to 8 of 8
  1. #1
    peiceonly is offline Member
    Join Date
    Mar 2007
    Posts
    41
    Rep Power
    0

    Default Executing a jar file

    Hi all
    How can I execute a jar file ?
    how can I make such file ?
    Will it be executed as an exe file in windows ?

  2. #2
    goldhouse is offline Senior Member
    Join Date
    Mar 2007
    Posts
    134
    Rep Power
    0

    Default

    Sun defines the jar files as below
    JAR file is a file format based on the popular ZIP file format and is used for aggregating many files into one. A JAR file is essentially a zip file that contains an optional META-INF directory. A JAR file can be created by the command-line jar tool, or by using the java.util.jar API in the Java platform. There is no restriction on the name of a JAR file, it can be any legal file name on a particular platform.

    In many cases, JAR files are not just simple archives of java classes files and/or resources. They are used as building blocks for applications and extensions. The META-INF directory, if it exists, is used to store package and extension configuration data, including security, versioning, extension and services.

    The main attributes for the Manifest file include Main-Class : where you can specify the entry class for the jar file.
    But still this is not like exe because it is just the zipped classes and it is platform independent.

  3. #3
    levent Guest

    Default

    The main attributes for the Manifest file include Main-Class : where you can specify the entry class for the jar file.
    But still this is not like exe because it is just the zipped classes and it is platform independent.
    Normally, when you installed a JRE on a machine, it adds a filetype "jar" associated with java.exe. With that association, when you double click on a jar file, it is run by JRE. (If Main-Class attribute set correctly as goldhouse stated.)

  4. #4
    kaydell2 is offline Senior Member
    Join Date
    Dec 2012
    Posts
    107
    Rep Power
    0

    Default Re: Executing a jar file

    A .jar file can be run without modification on Macs, Windows computers, and on Linux computers.

    Jars are executables, but they aren't .exe files. If you need something other than a "plain vanilla" .jar executable file, you can take your .jar files and convert them to .exes to be run on Windows and convert them to .apps to be run on Mac etc.

  5. #5
    AlexGraal is offline Señor Member
    Join Date
    Jan 2014
    Posts
    164
    Rep Power
    0

    Default Re: Executing a jar file

    You don't need to answer the ones that are reallllly old

  6. #6
    kaydell2 is offline Senior Member
    Join Date
    Dec 2012
    Posts
    107
    Rep Power
    0

    Default Re: Executing a jar file

    You don't need to answer the ones that are reallllly old
    Sorry, I sorted by fewest answers trying to answer questions with no answers.

    It was only after answering this question that I realized that the question were from the year 2007.

  7. #7
    kaydell2 is offline Senior Member
    Join Date
    Dec 2012
    Posts
    107
    Rep Power
    0

    Default Re: Executing a jar file

    It seems to me that the years old questions with no answers serve no purpose and should be deleted.

    We're not supposed to answer them.

    There are no answers to learn from.

    So why not delete them, since they are only cluttering up searches of trying to find unanswered questions to answer?

  8. #8
    gimbal2 is online now Just a guy
    Join Date
    Jun 2013
    Location
    Netherlands
    Posts
    3,712
    Rep Power
    5

    Default Re: Executing a jar file

    IMO just stick to what's in 'what's new' after the first day you signed up; if people stay stuck while their posts drop off there, you can expect a bump.

    So why not delete them, since they are only cluttering up searches of trying to find unanswered questions to answer?
    You ask too much of poor JosAH. This site is pretty much leaderless and there are only a very few people still moderating; it is already enough trouble to clean up the daily spam attacks.
    "Syntactic sugar causes cancer of the semicolon." -- Alan Perlis

Similar Threads

  1. Problem with executing
    By mcal in forum New To Java
    Replies: 2
    Last Post: 02-09-2008, 01:51 PM
  2. executing the java file
    By TheBayWatchMan in forum New To Java
    Replies: 4
    Last Post: 01-12-2008, 09:31 AM
  3. Problem with executing .jar files
    By hiranya in forum NetBeans
    Replies: 2
    Last Post: 10-02-2007, 07:24 PM
  4. Executing Batch
    By zcoarens in forum New To Java
    Replies: 0
    Last Post: 08-14-2007, 09:49 AM
  5. Problem while executing programs
    By bks504 in forum New To Java
    Replies: 10
    Last Post: 08-02-2007, 01:32 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •