From the course: Java 8 Essential Training

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Packaging classes in JAR files

Packaging classes in JAR files - Java Tutorial

From the course: Java 8 Essential Training

Start my 1-month free trial

Packaging classes in JAR files

- A JAR file is a Java archive. A file in ZIP format that contains one or more Java classes, pre-compiled, so that you can run the JAR file as a complete application. This is all done using a tool that's included with the Java Development Kit, called JAR. But you have access to that file through IntelliJ IDEA, and other IDEs. I'll describe how to create this JAR file using IntelliJ IDEA. And I'm using a project named JarFiles. This is my internet project. It's a single class project that makes a request to a web server and downloads some XML content. So I'm going to wrap this up as a package, and then I should be able to take that JAR file and move it to any operating system for which there's a valid Java Runtime. And it should work exactly the same everywhere. With the project open, I'll go to the menu, and choose File, Project Structure. Then I'll click on Artifacts, under Project Settings. I'll click + and choose JAR, and then From modules with dependencies. You can only add one…

Contents