Java apps can be exported as desktop applications. The file format is called JAR and is runnable on platforms where Java is supported. In this video, learn how to export your app as a runnable JAR file.
- [Instructor] So let's say you built an app with Java, and you want to distribute it as a runnable file. So here's an app that we built in a previous chapter, where you can type in your name, hit the button, and then you see Hi in the label. Let's look at exporting this as a runnable JAR file. Close this out, head back over to Eclipse, and then I'm going to show the project navigator by clicking these two windows right here, this button on the left. And then I'm going to select my project, and I'm going to use the File menu to go to File, Export. And what I want to export is under Java. I want to export a runnable JAR file. So hit Next after selecting that. And then we'll need to choose a launch configuration, so click the drop-down, choose your project. Then we need to choose an export destination. I'll browse to the Desktop. I'll just go in there with the shortcut Command + D. And I'll save this as Hello, and then I'll hit Save. And here, under Library handling, you can choose if you want to extract the required libraries into generated JAR, or if you want to package them into the generated JAR, or if you want to copy them into a sub-folder. Since we want one executable file, I'm just going to choose that top option, and then I'm going to hit Finish. Let's tab back over to Finder, and there's our JAR file. So at this point, I should be able to just double-click on the file and have it open up and run the application, just like any other native app in my operating system. And there we go, so we can publish a runnable JAR file by simply exporting our project.
Author
Released
3/21/2019- Installing Java
- Choosing an IDE
- Creating a Java class
- Java language basics
- Creating a UI with Swing
- Storing data in tables and arrays
- Publishing and using JAR files
- Creating a JPS project
- Writing server-side Java
- Developing Android apps with Java
Skill Level Beginner
Duration
Views
Related Courses
-
Java Essential Training for Students
with Peggy Fisher3h 6m Intermediate -
Java Essential Training: Syntax and Structure
with David Gassner3h 12m Intermediate -
Learning Java (2018)
with Kathryn Hodge2h 11m Beginner -
Java Essential Training: Objects and APIs
with David Gassner2h 49m Intermediate
-
Introduction
-
1. Install Java and an IDE
-
Pick a Java IDE2m 35s
-
Install Eclipse1m 9s
-
Eclipse setup3m 43s
-
Create a Java class4m 36s
-
-
2. Java Basics Review
-
Variables3m 26s
-
Functions3m 27s
-
Arrays4m 47s
-
Conditional statements4m 43s
-
Classes5m 44s
-
Input and output2m 51s
-
Read data from a file5m 46s
-
Handle Java errors3m 9s
-
-
3. Create a User Interface with Swing
-
Install Swing tools1m 45s
-
Swing basics4m 3s
-
Layout tools4m 3s
-
Labels and buttons3m 6s
-
Connect UI elements to code4m 16s
-
Check boxes3m 36s
-
Radio buttons2m 27s
-
Listener classes7m 12s
-
-
4. Tables and Data Sources
-
Tables5m 13s
-
Scroll a table2m 30s
-
-
5. Distribution and Deployment
-
Publish a runnable JAR file1m 48s
-
-
6. Server-Side Java: JSP
-
Install Java EE1m 26s
-
Install Tomcat56s
-
Create a JSP project3m 11s
-
Write server-side Java2m 36s
-
-
7. Android Development
-
Conclusion
-
Next steps1m 27s
-
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.
CancelTake notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.
Share this video
Embed this video
Video: Publish a runnable JAR file