Download ArticleDownload Article

This How.com.vn teaches you how to create a Java compressed folder, also known as a JAR file, using a free Java program called Eclipse. You can do this on both Windows and Mac computers.

Quick Steps

  • Install the Java Developer's Kit and Eclipse.
  • Place all files into the same folder.
  • Open the folder in Eclipse and select all its contents.
  • Click Export... and select JAR File.
  • Select a save destination to export it.
Part 1
Part 1 of 2:

Installing Eclipse

Download Article
  1. How.com.vn English: Step 1 Make sure that you have the Java Developer's Kit installed.
    If you don't have the JDK installed on your computer, download and install it on your Windows or Mac computer before continuing.
  2. How.com.vn English: Step 2 Open the Eclipse website.
    Go to https://www.eclipse.org/.
    • If you already have Eclipse installed on your computer, skip to the next part.
    Advertisement
  3. 3
    Click DOWNLOAD. It's a teal button near the top of the page.
  4. How.com.vn English: Step 4 Click DOWNLOAD.
    This orange button is near the top of the following page. Doing so will prompt Eclipse to download to your computer.
  5. How.com.vn English: Step 5 Wait for Eclipse to finish downloading.
    The download may take a few minutes.
  6. How.com.vn English: Step 6 Install the Eclipse installer.
    To do so:
    • Windows - Double-click the Eclipse setup file, then click Yes when prompted.
    • Mac - Double-click the Eclipse ZIP folder, then wait for the file to extract.
  7. How.com.vn English: Step 7 Open the Eclipse installer.
    Double-click the purple Eclipse icon when it appears. This will open the Eclipse installer.
    • If you clicked the Change Mirror link below the orange DOWNLOAD button earlier, Eclipse may instead open to the main program. If so, skip ahead to the "Click Browse" step.
  8. How.com.vn English: Step 8 Click Eclipse IDE for Java Developers.
    It's the top option in the Eclipse installer.
  9. How.com.vn English: Step 9 Click INSTALL.
    This yellow button is near the bottom of the page. Doing so will prompt Eclipse to begin installing onto your computer.
    • You can first change the installation folder by clicking the folder icon to the right of the "Installation Folder" field and then selecting a specific folder on your computer.
    • If you don't want to install shortcuts for Eclipse, uncheck the shortcut boxes before clicking INSTALL.
  10. How.com.vn English: Step 10 Click LAUNCH when it appears.
    This green button is at the bottom of the installer window. Clicking it will open Eclipse.
  11. How.com.vn English: Step 11 Click Browse….
    It's on the right side of the window. A File Explorer (Windows) or Finder (Mac) window will open.
  12. How.com.vn English: Step 12 Select a workspace folder.
    Click a folder that you want to use on the left side of the screen. This is where your Eclipse project files will be stored.
  13. How.com.vn English: Step 13 Click Select Folder.
    It's in the bottom-right corner of the window.
  14. How.com.vn English: Step 14 Click Launch.
    You'll find this at the bottom of the window. Eclipse's main page will open.
  15. Advertisement
Part 2
Part 2 of 2:

Creating a JAR File

Download Article
  1. How.com.vn English: Step 1 Place all of your files in one folder.
    The files that you want to bundle into your JAR file all have to be in the same folder before you can continue.
  2. How.com.vn English: Step 2 Click File.
    It's in the top-left corner of the window (Windows) or in the top-left corner of the screen (Mac). A drop-down menu will appear.
  3. How.com.vn English: Step 3 Click Open File….
    This option is near the top of the drop-down menu.
  4. How.com.vn English: Step 4 Open your files' folder.
    Go to the folder where the files that you want to use are, then double-click the folder to open it. You should see a list of the files in the window.
  5. How.com.vn English: Step 5 Select your folder's contents.
    Click a file, then press Ctrl+A (Windows) or Command+A (Mac) to select all of the files in the folder.
  6. How.com.vn English: Step 6 Click Open.
    It's in the bottom-right corner of the window. Doing so will open your files in Eclipse.
  7. How.com.vn English: Step 7 Click File.
    The File drop-down menu will reappear.
  8. How.com.vn English: Step 8 Click Export….
    It's near the bottom of the drop-down menu.
  9. How.com.vn English: Step 9 Double-click Java.
    This option is near the top of the page.
  10. How.com.vn English: Step 10 Click JAR file.
    It's below the Java item that you double-clicked.
    • If you want the JAR file to be executable like a program, click instead the Runnable JAR file option here.
  11. How.com.vn English: Step 11 Click Next.
    It's at the bottom of the window.
  12. How.com.vn English: Step 12 Select resources to export.
    Click the checkbox next to any unchecked resources that you want to package into your JAR file. You'll do this in the window at the top of the page.
    • Skip this step if you chose to create a runnable JAR file.
  13. How.com.vn English: Step 13 Select a save location.
    Click Browse…, type in a name for your file, click a folder in which you want to save the JAR file, and click Save.
  14. How.com.vn English: Step 14 Click Finish.
    Doing so will create your JAR file, though the compression process may take awhile.
  15. Advertisement


Community Q&A

Search
Add New Question
  • Question
    How can I create a Java project that can be run with a single click?
    How.com.vn English: Community Answer
    Community Answer
    You should create a runnable jar. You can do this with an IDE like eclipse. Go to Export >> Runnable jar -- then it will export your java project with a MANIFEST.MF file that specifies your main class. After that, you can simply run your runnable jar by double clicking.
Ask a Question
200 characters left
Include your email address to get a message when this question is answered.
Submit
      Advertisement

      Tips

      Submit a Tip
      All tip submissions are carefully reviewed before being published
      Thanks for submitting a tip for review!

      About This Article

      How.com.vn English: Jack Lloyd
      Written by:
      How.com.vn Technology Writer
      This article was co-authored by How.com.vn staff writer, Jack Lloyd. Jack Lloyd is a Technology Writer and Editor for How.com.vn. He has over two years of experience writing and editing technology-related articles. He is technology enthusiast and an English teacher. This article has been viewed 438,677 times.
      How helpful is this?
      Co-authors: 30
      Updated: January 20, 2024
      Views: 438,677
      Categories: Java
      Article SummaryX

      1.Place all of your files into one folder.
      2.Open Eclipse.
      3.Go to File > Open File.
      4.Open the folder and select all files inside.
      5.Click Open.
      6.Go to File > Export.
      7.Select Java > JAR file.
      8.Click Next.
      9.Choose your preferences and click Finish.

      Did this summary help you?

      Thanks to all authors for creating a page that has been read 438,677 times.

      Is this article up to date?

      ⚠️ Disclaimer:

      Content from Wiki How English language website. Text is available under the Creative Commons Attribution-Share Alike License; additional terms may apply.
      Wiki How does not encourage the violation of any laws, and cannot be responsible for any violations of such laws, should you link to this domain, or use, reproduce, or republish the information contained herein.

      Notices:
      • - A few of these subjects are frequently censored by educational, governmental, corporate, parental and other filtering schemes.
      • - Some articles may contain names, images, artworks or descriptions of events that some cultures restrict access to
      • - Please note: Wiki How does not give you opinion about the law, or advice about medical. If you need specific advice (for example, medical, legal, financial or risk management), please seek a professional who is licensed or knowledgeable in that area.
      • - Readers should not judge the importance of topics based on their coverage on Wiki How, nor think a topic is important just because it is the subject of a Wiki article.

      Advertisement