Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7626181
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T05:17:30+00:00 2026-05-31T05:17:30+00:00

how can I make jar for my java files in linux? I have this

  • 0

how can I make jar for my java files in linux?
I have this situation:
I have in directory src this stuff:

   Client.java  //source code
    GUI.java    // source code
    miglayout-lib.jar //external lib 
    icons // folder in which are 20 jpeg pictures

when I want to compile it I use

javac -cp "miglayout-lib.jar:." *.java

when I want to run it I use

java -cp "miglayout.jar:." Klient

//cause Klient is class with main.
How can I make some build file or script (something like make) which will make me one jar file with my application and I’will be able to run it?

Thx.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T05:17:30+00:00Added an answer on May 31, 2026 at 5:17 am

    You can use command line utility named jar e.g.

    jar cvf classes.jar .*.class

    Use online help of jar for more info.

    Since jar is a part of JDK it is cross platform, so it works on all operating systems.
    But it is very low level. You can use it as an exercise but in real life I’d recommend you to use one of popular build tools like ant, maven, buildr, gradle etc.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Can someone please explain how JAR files and the Java class loader make use
I have a project set up like this; Project -src -com -top -classes Class_3.java
Summary How can you make ant repeatedly generate byte-identical jar files from the same
Can someone tell me how I can make the following output? I have a
tl;dr: C++ plugin needs to call Java .jar library. How to deploy this to
I'm trying to make an executable war file ( java -jar myWarFile.war ) that
My command line app call looks like this: java -jar myapp.jar --output c:\test.txt c:\test.txt
I want to call some R code from within Java, on a Linux machine
This is mind-boggling... I can make getResource() and getResourceAsStream() work properly when I run
I have a 3rd party JAR file that is compiled using Java 1.4. Is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.