Latest LQ Deal: Linux Power User Bundle
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 02-14-2014, 09:48 AM   #1
LQ Newbie
Registered: Feb 2014
Posts: 1

Rep: Reputation: Disabled
problem with running .jar file in red-hat Linux

I wan to run a .jar file in Linux red-hat but when I give the command,
java -jre Myfile.jar
I get this error
The jar file is missing the manifest entry for the main class: Myfile.jar
Old 02-15-2014, 01:40 AM   #2
Senior Member
Registered: Jan 2002
Location: germany
Distribution: ubuntu, mint, suse
Posts: 1,550

Rep: Reputation: 136Reputation: 136
Welcome to LQ, babarhussain29!

Have you tried to run the jar with a complete directory path, something like
java -jre /home/me/Myfile.jar

Is the jar file ok?
Old 02-15-2014, 04:18 AM   #3
Registered: Oct 2013
Distribution: Debian Sid, Gentoo, Arch, Debian
Posts: 169
Blog Entries: 4

Rep: Reputation: 24
Dear babarhussain29,

Brief Theory:
As far as I know, every jar file is an archive just like .zip, .gz file etc.
In it there resides a file known as MANIFEST.MF usually in a folder META-INF.

In this file there is an entry as

Main-Class: a.b.programs_main

(where program_main is your main class file, if you know java programming I hope you can understand concept of main class well. a and b etc are top level directory.)

What seems:
So perhaps the aforementioned entry is missing from the MANIFEST.MF file.

This may be due to the file is corrupted (let say in downloading), or if you have manually created it, then it may be you haven't put above line or forgot to create entire menifest file.

Can you tell us where you have got that file?

Possibly, you can manually unpack that jar file and edit MANIFEST.MF for the main class entry and repack and run it again.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Jar file running problem in RED HAT 5 kumartvm Red Hat 3 09-08-2011 08:15 AM
Jar file running problem netpumber Slackware 1 01-28-2009 11:42 AM
Problem with running hamachi on Red Hat Linux 9 umair_amin Linux - Software 4 05-19-2008 08:19 PM
Problem when running J2EE in red hat linux roy_tan711 Linux - Software 3 05-13-2003 11:21 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 04:55 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration