0

Here is a brief summary:

I have a large project on Eclipse with numerous classes and Maven dependencies. This java class is part of a script I plan to make. Basically, this collection of classes will be called by the script using java and javac, or whatnot, and in turn, the program will output many JSON files to be interpreted by an HTML file.

What is the best way to do this? I tried using JARS and running them independently, but for some reason, the Maven dependencies were not included, so some of the classes, like JSONObject, did not work.

As you can probably tell, I am a relatively beginner to development, so I'd appreciate any help. Thanks in advance.

stoneman
  • 25
  • 5

1 Answers1

0

Maven gives you tool to build executable jars with dependencies. You just need to configure your POM file accordingly.

Maven: Packaging dependencies alongside project JAR?

Above URL can explain you details for configuring POM.

EDIT

If you want your own JAR configuration without MAVEN, then you need to learn about Manifest file.

JAR files support a wide range of functionality, including electronic signing, version control, package sealing, and others. What gives a JAR file this versatility? The answer is the JAR file's manifest.

The manifest is a special file that can contain information about the files packaged in a JAR file. By tailoring this "meta" information that the manifest contains, you enable the JAR file to serve a variety of purposes.

Details can be found at location below :

http://docs.oracle.com/javase/tutorial/deployment/jar/manifestindex.html

Community
  • 1
  • 1
user3657302
  • 347
  • 1
  • 5
  • Sorry if my question wasn't clear enough, but the main purpose wasn't Maven. I mean for my project in general, how do I make sure my JAR works properly, beucase I get numerous errors when trying it. Also, what's the best way to run a main method in a class located within the JAR? – stoneman Jun 30 '14 at 21:20
  • I have added custom jar related details in answer. Please go through it. – user3657302 Jul 01 '14 at 11:12