LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


Reply
  Search this Thread
Old 02-14-2014, 10:48 AM   #1
babarhussain29
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,
Code:
java -jre Myfile.jar
I get this error
Code:
The jar file is missing the manifest entry for the main class: Myfile.jar
 
Old 02-15-2014, 02:40 AM   #2
j-ray
Senior Member
 
Registered: Jan 2002
Location: germany
Distribution: ubuntu
Posts: 1,532

Rep: Reputation: 132Reputation: 132
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, 05:18 AM   #3
s.verma
Member
 
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.
 
  


Reply


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 09:15 AM
Jar file running problem netpumber Slackware 1 01-28-2009 12:42 PM
Problem with running hamachi on Red Hat Linux 9 umair_amin Linux - Software 4 05-19-2008 09:19 PM
Problem when running J2EE in red hat linux roy_tan711 Linux - Software 3 05-13-2003 12:21 PM


All times are GMT -5. The time now is 11:01 AM.

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