T
T
Tarasov Konstantin2015-02-03 18:02:45
Java
Tarasov Konstantin, 2015-02-03 18:02:45

How to create jar programmatically?

I want to write a compiler for a simple language into jvm bytecode. But it is necessary that the output is one executable file, i.e. jar. How can I package compiled classes into a jar programmatically?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
T
Tagir Valeev, 2015-02-04
@tagir_valeev

The JDK has a standard JarOutputStream class to help you. Here is an example of writing to a JarOutputStream along with a manifest.

T
Talik, 2016-01-25
@Talik0507

Use Maven to build your project.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question