Page History
Div | ||||||
---|---|---|---|---|---|---|
| ||||||
|
...
...
...
...
Structure of a Java Service Repository
A Java service repository has to be a self-contained JAR file containing also a folder META-INF/MANIFEST.MF holding the meta information of the Java Service.
...
...
...
Adding Information to META-INF/MANIFEST.MF
You cannot directly create or edit the MANIFEST.MF. There are two ways to add information to this file:
- Use the command line JAR tool as described in the Java tutorial Modifying a Manifest File.
- Do it within Java code as described in Add Manifest into JAR File Using Java.
Building the JAR File
...
...
...
This approach provides you with a complete Eclipse/Ant application directory, that you can use as a starting point for your own One-JAR application. The application generator is driven by a template built into the one-jar-appgen.jar file (see one-jar-appgen).
- Download one-jar-appgen-0.97.jar.
Generate the application, build, and run it.
Code Block language none $ java -jar one-jar-appgen-0.97.jar Enter project path (project name is last segment): c:/tmp/test-one-jar Enter java package name: com.example.onejar $ cd c:/tmp/test-one-jar $ ant $ cd build $ java -jar test-one-jar.jar test_one_jar main entry point, args=[] test_one_jar main is running test_one_jar OK.
Add source code to the src directory, library jars to the lib directory, and rebuild.
If you are using IntelliJ IDEA, you can import the project template BridgeJavaServiceTemplate.jar which uses the Gradle plugin gradle-one-jar.
Use
...
...
...