Jar does not execute.

Asked

Viewed 1,231 times

3

I’m having a problem running a jar file. that I made.

When I click on run nothing just happens, no window opens, no error message or anything.

In the folder of Meta-inf has the file MANIFEST.MF containing only Manifest-Version: 1.0.

The name of PACK is REDE and the class that owns the main I’m looking forward to chatserver.

What I must do to be executed?

  • How did you generate this jar? Was the via command line?

  • Reinstall java, and try again.

  • 2

    What do you mean "reinstall Java"? @cypherpotato

  • .jar is a Java executable, sometimes the error may be in your Java...

  • 4

    Just so you know, you’ve tried running from the command line java -jar arquivo.jar? If yes, what does it show on the console and what happens after you do it? If you run java -version, what is shown? With which compiler the JAR was generated?

  • 1

    Some exception may be occurring. Try to do what @Victorstafusa said: run by command line and see what it shows on the console.

Show 1 more comment

1 answer

1

As you say you already have the MANIFEST.MF file inside the META-INF folder, what you lack now is to indicate in that file the full address of your main class, so:

Main-Class: com.pacote.Classe

In your case it would be:

Main-Class: NETWORK.chatserver

However, note that both your package name and your class name escape the naming convention defined by Javabeans Standard, which says that packages should be written in lower case, while classes should follow the default PascalCase, therefore, the most appropriate would be for the full address of your class to be: rede.ChatServer

Browser other questions tagged

You are not signed in. Login or sign up in order to post.