R
R
random2015-01-11 14:51:55
Java
random, 2015-01-11 14:51:55

Creating a Jar Archive?

I have 2 java files, in one of which the server is written (for a regular chat), and in the second the application itself. And in both classes there is main ()
Created a jar for the application, everything works.
1) First compiled: javac MyApp.java
2) Created a manifest and wrote Main-Class: MyApp
3) And this is how I created the jar: jar -cvmf manifest.txt MyApp.jar *.class
But the chat does not work in the application.
Question: How can I make the server and application start when I click on the jar?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
O
one pavel, 2015-01-11
@demon123

The manifest points to a class that has a main to start with. Only one class can be specified. Make another proxy class that will contain main and create server and application objects in the main.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question