I have mostly worked on simple java programs and compiled and run them with Eclipse on Windows. So, I have no experience of using command prompt for compiling Java projects and do not have much info about what actually happens beneath the play button in Eclipse.

Now I have to submit a Java application which will have basic operation on XML. My project also will have (JUnit) Unit Test.

My question is related to submission of this Project.

  1. Which files would be necessary to submit the code. So, it executes properly?
  2. Does choosing Eclipse as an IDE or junit as a unit testing framweork produces any dependenices i.e the executor of the program should have eclipse/libraries to execute the program on his machine?
  • Where are you submitting your project to?
    – Bernard
    Commented Apr 15, 2012 at 17:26
  • @Bernard : Meaning ??
    – mu_sa
    Commented Apr 16, 2012 at 10:47
  • 1
    "Which files would be necessary to submit the code." Where are you submitting the code to? You weren't specific on this. Is it part of an open source project? Going directly to a customer?
    – Bernard
    Commented Apr 16, 2012 at 13:40
  • It had to be directly submitted to the customer. But would it matter if this would have been a open source project..
    – mu_sa
    Commented Apr 17, 2012 at 5:57
  • In that case, I wouldn't include your unit tests unless the customer specifically asks for them.
    – Bernard
    Commented Apr 17, 2012 at 13:21

2 Answers 2


If your application is doing XML operations and has JUnit tests then the only real dependency there is the dependency to junit.jar. Your application should not need any Eclipse specific libraries on the classpath.

You sound as if you do not have a complete understanding of what the classpath is and how it relates to the compilation and execution of Java code. I highly recommend that you learn how to develop a simple application with a text editor and the command line.

As far as submitting your code, you can compile and package your code into a JAR file, and submit this along with junit.jar and a simple batch file or shell script that will execute the Java virtual machine to run your program.

Another way would be to compile your program, unpackage junit.jar, and package it all together into an Executable Jar file. All of your classpath dependencies will be self contained within the one file and on most operating systems it can be launched as a typical executable.


You can easily use the Eclipse "file->export->java->jar" function to create a compiled package of your code. You can select various options depending on your wishes, e.g. exporting the source with it. If you select "runnable jar file", you can easily select a run configuration which Eclipse will "embed" into the .jar file.

Using an IDE should not add dependencies to your code. Using a unit testing framework does of course add the testing framework as a dependency for running the tests (but does not add them as a dependency for your main code).

You might also want to look at Maven, which can automate dependency management and the creation of output (Maven calls them target) files.

  • 2
    +1 for maven; IMO one of the only sane ways in the Java ecosystem to manage dependencies Commented Apr 10, 2012 at 15:10
  • 1
    One of my biggest problems with Maven is that it shelters application complexities like dependency management from developers like the OP to where they still do not understand the basic fundamentals of the classpath. That and I am a control freak with my dependent libraries and like gathering the specific versions of everything into one place that I control. There is still a sizable Anti-Maven community in Java.
    – maple_shaft
    Commented Apr 10, 2012 at 16:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.