Eclipse How to Ask a User to Play Again

Download Article

Download Article

Subsequently having completed your project in Eclipse, your side by side goal will be to create a runnable version of your projection. While Eclipse doesn't have the power to consign a Java project every bit an ".exe" file, you can export it as a runnable JAR (.jar) file, which works similar to an executable (.exe) file. You tin then use a program called Launch4j to convert the JAR file to an executable file. This wikiHow teaches you how to transform a typical ".jar" file to an executable file!

  1. one

    Open Eclipse. Eclipse has an icon that resembles a blueish circle with lines through information technology and a xanthous crescent. Click the icon to open Eclipse. This will open your most recent Java project in Eclipse.

    • If Eclipse does not open the Java project you lot want to export, run across if you tin find the project binder in the Package Explorer to the left. If yous can't, click File in the menu bar and click Open up file. Navigate to the ".java" file you want to open and click Open. You tin besides find contempo project under Open contempo in the "File" card.
  2. 2

    Right-click your projection and click Refresh . You projection is listed in the panel to the right. Right-click it and click Refresh near the lesser of the menu. This is to ensure all your code is up to date and won't disharmonize when you try to export it.

    • Alternatively you tin can correct-click and hit F5 on your keyboard.

    Advertisement

  3. 3

    Right-click your project and click Consign . Information technology's in the menu that appears when you right-click your project in the Package Explorer panel to the left.

  4. 4

    Aggrandize the "Coffee" binder and double-click the Runnable JAR file choice. This option allows yous to relieve your project as a runnable JAR file.

  5. 5

    Select the main class. The main grade is the class that contains the method with the identifier called "main". This is the class that indicates where your program begins. Utilize the drop-downwardly carte nether "Launch configuration" to select the main form of your project.

  6. 6

    Select an consign destination and file name. This is the location you volition export the JAR file to. You can either type the destination in the field below "Export destination" or apply the following steps to select an Consign destination:

    • Click Browse.
    • Navigate to the folder you want to save the JAR file to.
    • Type a name for the JAR file adjacent to "Filename".
    • Click Save.
  7. 7

    Ensure the "Extract required libraries into generated JAR" radio push is selected. Do non worry about the rest of the bill of fare.

  8. 8

    Click End . This exports your Java projection every bit a JAR file.

    Advertisement

  1. 1

    Find or create an image. This is the icon you will employ to click on your program. You can search for an icon to apply online, or yous can utilise a graphics programme similar Photoshop, GIMP, Pigment, or Preview to create your ain graphic.

    • The image size must be 256x256 in guild to work properly as an icon.
  2. 2

    Go to https://convertico.com/. This is a free site that converts common paradigm files (.png, .jpg) to a usable ICO (.ico) file.

  3. 3

    Drag your icon to the box with dashed lines. It's in the heart of ConvertICO. This volition upload your paradigm file and convert it to a ICO file.

    • Alternatively, if yous have an image from the net, you can enter the web address in the bar that says "Select file from URL".
  4. 4

    Click the arrow icon. It's in the box to the right. One time your file is uploaded, this box turns pink and an arrow pointing down appears. Click the arrow to download the image as an .ICO file.

    • By default, you can find your downloaded files in your Downloads binder.

    Ad

  1. 1

    Download Launch4j. This is a free program designed to compile all your resources into one executable file. Use the following steps to download and install Launch4j.

    • Go to http://sourceforge.net/projects/launch4j/files/launch4j-three/three.1.0-beta1/
    • Click Download the latest version.
    • Wait 5 seconds for the download to kickoff.
    • Open the "launch-three.12-win32.exe" in your web browser or Downloads folder.
    • Click Yes
    • Click Next.
    • Click I agree.
    • Click Browse to select an install location (optional).
    • Click Install.
    • Click Finish.
  2. ii

    Open Launch4j. To open Launch4j, click the Windows Kickoff menu and type "Launch4j". Click the Lanuch4j icon. It resembles a computer screen with an IDE plan open.

  3. 3

    Select a destination and name for the output file. Use the post-obit steps to select a destination and name for the executable file that will exist exported.

    • Click the blueish folder icon adjacent to the "Output file" bar.
    • Navigate to the location you desire to save the file to.
    • Blazon the proper name of the file adjacent to "Filename" (brand certain information technology has the ".exe" file extension at the terminate).
    • Click Salve.
  4. four

    Select the JAR file. Use the following steps to select the JAR file y'all exported from Eclipse.

    • Click the blue folder next to the bar labeled "Jar".
    • Navigate to the folder with your "JAR" file.
    • Select the JAR file and click Open up.
  5. v

    Select the ICO file. Use the post-obit steps to select the ICO file.

    • Click the blueish folder next to the bar that says "Ico".
    • Navigate to the folder with your ICO file.
    • Select the ICO file and click Open up.
  6. half-dozen

    Click the JRE tab. It'south the 5th tab at the top. This tab allows you to select which version of Java you want to use.

  7. seven

    Type 1.4.0 next to "Min JRE version". This ensures that the users accept a sufficient version of Java to employ your programme. Yous can enter a different version if needed. Version 1.4.0 is a condom version for most users.

  8. viii

    Click the gear push button at the tiptop. This is the gear button that says "Build Wrapper" when you hover over it.

  9. ix

    Requite the XML (.xml) file an appropriate proper name and click Save . Virtually users won't see the XML file. Give it any name you choose. Type the name of the file next to "Filename" and click Salve. Your executable file will now exist created!

    • Y'all may demand to temporarily disable your antivirus software to run the executable.

    Advertizing

Add New Question

  • Question

    What should I do if the executable file doesn't open?

    Community Answer

    Check if you exported JAR properly, defined all the paths, and launched configuration according to your main class. The JAR export might be damaged, in which case your .exe file wouldn't piece of work.

  • Question

    Is it possible to wrap an appropriate version of JRE with the executable so that the end user doesn't demand whatsoever JRE installed to run the program?

    Community Answer

    Yes. In Launch4j, under the JRE tab, it'southward the first field at the top.

  • Question

    Where should I get a .ico file?

    Community Answer

    You can create a .ico file yourself with SIB icon editor, or download from the web.

  • Question

    When I try to launch, it just loads without doing anything. What should I practice?

    Community Answer

    Check your version of Eclipse. If your version has a Bundle Explorer folder, then consign your project to the run-able JAR file from the "Package Explorer" folder, not the "Project Explorer" folder. After that, follow all other steps as outlined in this article.

  • Question

    Does every subclass branching off from the main get included as well?

    Community Answer

    Everything inside the project folder which you lot are extracting is included. Classes outside the folder only get a reference if they are linked with your content.

  • Question

    What do I do if I have created an .exe JAR file, but it is not showing an icon image?

    Community Answer

    Make sure your icon dimensions are 256x256 and that the file format is .ico co-ordinate to the instructions above. However, you will probably have to consign JAR to .exe once again.

  • Question

    How do I save an executable file from Eclipse as a jar file?

    Community Answer

    In Projection Explorer, right click on the projection that y'all want to catechumen. Then click on Export and look out for JAR File in the JAVA Folder.

Ask a Question

200 characters left

Include your email address to get a message when this question is answered.

Submit

Advertisement

Nigh This Article

Article Summary Ten

1. Open up Eclipse.
2. Press F5 to refresh your projection.
3. Right-click your project and click Export.
four. Expand "Java" and double-click Runnable JAR file followed by Side by side.
5. Select the main grade under "Launch configuration".
6. Click Browse and select a destination and filename.
7. Ensure "Extract required libraries into generated JAR" is selected and click Finish.
eight. Find or make a 256 x 256 image to use an as icon.
ix. Convert the epitome to an "ico" file at https://convertico.com/
10. Download Launch4j at http://sourceforge.net/projects/launch4j/files/launch4j-3/3.one.0-beta1/.
11. Open up Launch4j and type and destination for the file next to "Output File".
12. Select the JAR location adjacent to "Jar".
13. Select the Ico file next to "Ico".
fourteen. Click the JRE tab and type "1.four.0" next to "Min JRE". 15. Click the gear icon and blazon a name for the ".xml" file next to "Filename" and click "Relieve'.

Did this summary aid you lot?

Thanks to all authors for creating a folio that has been read 566,364 times.

Is this commodity upward to date?

wilbankscoperfell.blogspot.com

Source: https://www.wikihow.com/Create-an-Executable-File-from-Eclipse

0 Response to "Eclipse How to Ask a User to Play Again"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel