java – .jar does not run

Question:

I have a problem when running a .jar file I made.

When I click run nothing just happens, no windows open, no error messages or anything.

In the Meta-INF folder there is the MANIFEST.MF file containing only Manifest-Version: 1.0 .

The name of the PACK is REDE and the class that has the main I want to run is chatserver .

What do I have to do for it to run?

Answer:

As you say you already have the MANIFEST.MF file inside the META-INF folder, what you need now is to indicate in this file the complete address of your main class, like this:

Main-Class: with.package.Class

For your case it would be:

Main-Class: NETWORK.chatserver

However, note that both your package name and your class name are outside the naming convention defined by the JavaBeans Standard, which says that packages must be written in lowercase while classes must follow the PascalCase standard, so the most appropriate would be that the full address of your class would be: rede.ChatServer

Scroll to Top