I have download an API which has the following structure:
In the folder, there is a source folder and a build.xml file. How would I go about creating a jar out of this?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
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.
If the build.xml file doesn’t already have a target that creates a jar file, you can read about the ant jar command here:
However, there’s probably a good chance that the build file already does this for you.
You can run the build script by typing ant when you’re in the directory that contains the build.xml file (after unpacking the jar).
Just for fun, here is an example of a simple ant target that compiles some code and creates a jar.
This target will compile every .java file in any folder named reports.
As you can see, most of the values are using variables defined elsewhere in the script, but hopefully you get the idea…
The above was just created by modifying a build script generated by NetBeans.
You can run the above target by adding it to a build.xml file and typing the following from the command line:
Note: You’ll have to define all the variables for it to actually work.