LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
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, 09: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, 01:40 AM   #2
j-ray
Senior Member
 
Registered: Jan 2002
Location: germany
Distribution: ubuntu, mint, suse
Posts: 1,591

Rep: Reputation: 145Reputation: 145
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
s.verma
Member
 
Registered: Oct 2013
Distribution: Debian Sid, Gentoo, Arch, Debian
Posts: 186
Blog Entries: 4

Rep: Reputation: 25
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



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

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:11 PM.

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
Open Source Consulting | Domain Registration