.jar files do not open

0

Hello, I would like a help, I created a basic project in java but the .jar file does not open.

  • I already have jdk installed
  

Microsoft Windows (version 10.0.14393) (c) 2016 Microsoft Corporation.   All rights reserved.

     

C: \ Users \ Leo> java -version java version "1.8.0_121" Java (TM) SE   Runtime Environment (build 1.8.0_121-b13) Java HotSpot (TM) Client VM   (build 25.121-b13, mixed mode, sharing)

  • I have already created a path for java

  • double click does not open file

  • java -jar tbm nothing happens.

  • I tried to open other .jar files and nothing

I do not know what to try anymore.

    
asked by anonymous 13.02.2017 / 00:50

1 answer

3

You forgot to indicate your main class in the jar. The 'c' flag indicates that you want to create a new jar file and 'f' the file name.

  

The 'e' flag (for 'entrypoint') creates or replaces the Main-Class attribute of the manifest. It can be used when creating or updating a JAR file. Use it to specify the application entry point without editing or creating the manifest file.

jar cfe arquivo.jar foo.Main foo/Main.class foo/Outra.class

Source: link

    
13.02.2017 / 01:32