0

I'm trying to execute a jar file developed in Apache NetBeans 11.2 in Ubuntu 19.10 by double clicking it or launching via terminal (java -jar filename.jar) but it doesn't launch - nothing happens. It is a simple program that manages the daily work routine of an employee, it was programmed with Jframe GUI. And the program has I / O operations. I already made the jar file executable and i have JRE installed on Ubuntu. I have discovered that the manifest file is empty and it doesn't contain the main class, instead it has: "Manifest-Version: 1.0 X-COMMENT: Main-Class will be added automatically by build" It says that the main-class will be added automatically by build but it is not added. I developed another program (a game) in Intellij Idea IDE, whose the jar file has a manifest file containing the main class and even with the fact that i have used Liberica JDK in development the Open JRE associated with jar files works.

5
  • 4
    Welcome to Ask Ubuntu! I recommend that you edit this question to describe what method or methods you are using to attempt to open the file, and exactly what happens--including any error messages. In particular, if you are running one or more commands in a terminal, please include the complete and exact text of those commands as well as their full output. Nov 9, 2019 at 15:33
  • you tried the "-cp" option? do you have a main()? Nov 9, 2019 at 22:49
  • Yes i have a main() class and what is "-cp" option?
    – AtomX
    Nov 10, 2019 at 5:23
  • In the previous revision of question you mentioned that you developed the jar using Liberica JDK but running using OpenJDK13. Since LibericaJDK and OpenJDK are little bit different so it is not necessary that jar build using one would definitely run on other. If you have the source code, try building jar using OpenJDK and then run. Also, please mention what does the jar actually do. It might happen it executed but produced no output.
    – Kulfy
    Nov 10, 2019 at 9:11
  • Note: Some input files use or override a deprecated API. Note: Recompile with -Xlint:deprecation for details. Note: Some input files use unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for details. These were the error present in the build process. Thought, that was not the problem either the manifest file. I fixed the problem in the packing set-ups - properties of the project - It is working.
    – AtomX
    Nov 11, 2019 at 12:16

1 Answer 1

1

Maybe you must create launcher on desktop, with

/path /to /bin /file.jar

Also, you can debug your file with idea studio

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .