0

So I have inherited a project with org/projectname/Client.class containing the main class, and tons of other .class files in directories like org/projectname/ and org/projectname/backend/ (and some libraries in lib/, but I assume those are already compiled into the .class files and can be ignored).

I want to make a .jar executable that when run like java -jar Client.jar, starts off with Client.java and has all the classes/libraries inside that it needs to run, from the command line.

What's the easiest way to do this?

Dr-Bracket
  • 1,276
  • 8
  • 18
  • 4
    Does this answer your question? [javac option to compile all java files under a given directory recursively](https://stackoverflow.com/questions/6623161/javac-option-to-compile-all-java-files-under-a-given-directory-recursively) – MadaManu Jan 08 '20 at 02:49
  • 2
    why not use maven or ant or gradle? – Scary Wombat Jan 08 '20 at 02:50
  • You seem to be confused as to the nature of a jar file; it is ***literally*** a regular zip file with some structure specified by Sun (now Oracle). [Using JAR Files: The Basics](https://docs.oracle.com/javase/tutorial/deployment/jar/basicsindex.html) is a good place to start, but using maven, ant, gradle or sbt (there's always *one* more tool) is a better approach. – Elliott Frisch Jan 08 '20 at 02:58

0 Answers0