Saturday, April 27, 2024
3
rated 0 times [  3] [ 0]  / answers: 1 / hits: 23501  / 2 Years ago, tue, june 14, 2022, 10:06:43

Mispelled classname in manifest.txt file caused this error



enter image description hereenter image description hereIm trying to run a java file outside of my IDE by exporting the .jar file to my documents folder and trying to display the text 'hello world'in the file on the terminal line. I attempted to create a Manifest.txt file with this in it,



Main-Class: lightning.java.hello.MyFirstClass



I then used this script to create a file MyJar.jar and got this back,



lightning@rigel5:~$ jar cfm MyJar.jar Manifest.txt lightning.java.hello/*.class
java.io.FileNotFoundException: Manifest.txt (No such file or directory)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.(FileInputStream.java:138)
at java.io.FileInputStream.(FileInputStream.java:97)
at sun.tools.jar.Main.run(Main.java:171)
at sun.tools.jar.Main.main(Main.java:1177)


More From » command-line

 Answers
2

You can run java package using this command on your terminal:



java -jar MyFirstClass.jar


If you don't have Java Runtime Edition (JRE) you'll need to install default-jre package.


[#32314] Wednesday, June 15, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
impisaso

Total Points: 423
Total Questions: 106
Total Answers: 104

Location: Virgin Islands (U.S.)
Member since Tue, Feb 2, 2021
3 Years ago
;