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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
01-08-2009, 02:26 AM
|
#1
|
Member
Registered: Jul 2008
Location: Bangalore, India
Distribution: RHEL
Posts: 235
Rep:
|
Jar files in linux
Hi All,
Could anybody please tell me how to open and read a jar file in linux? I am using RHEL5, and unable to open any jar file.
Is there any way through which I can open them and edit them as well. Or is it like we cannot open jar files in linux??
Thank You in advance....
kapil Bajpai
|
|
|
01-08-2009, 02:50 AM
|
#2
|
LQ Addict
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-15.0
Posts: 11,376
Rep: 
|
jar files are in fact zipped files. So to open it in Linux: This will in most case create a hierarchy of files.
You may then edit any file of the hierarchy with your favorite text editor.
Once done if you want to update the jar file with the edited files you can use the zip command.
But if you are a Java programmer - unfortunately I am not (yet) one - you probably know how-to proceed.
|
|
1 members found this post helpful.
|
01-08-2009, 03:22 AM
|
#3
|
Red Hat India
Registered: Nov 2004
Location: Kerala/Pune,india
Distribution: RedHat, Fedora
Posts: 260
Rep:
|
Hello,
.jar files are java programs packaged into a single file which can be executed using 'java -jar <file.jar>'. In order to unpack, you can use 'unzip'.
|
|
0 members found this post helpful.
|
11-05-2009, 09:51 AM
|
#4
|
Member
Registered: Jul 2008
Location: Bangalore, India
Distribution: RHEL
Posts: 235
Original Poster
Rep:
|
Hi All,
Rather than opening a new thread, I am re-opening an old one that has relevence with this query.
I need to open jar files, those are either having .jar extension , or not having .jar extension but need similar procudure to open them.
"java -jar <file-name>" is fine to open the abc.jar file, but what would have been done to hold the file page-by-page, as it scrolls down to the end in one go ??
But "java -jar <file-name" is not enough to open other jar files without .jar as extension. For example, say I need to see file /usr/bin/java, then :
[--/bin]# java -jar java
gives:
"Invalid or corrupt jarfile java" as error message.
Similar message comes for most of the similar jar files in various directories.
Could anybody please suggest me how to open such files, and how can I see them on a page basis ??
Regards,
Kapil.
|
|
|
11-05-2009, 10:39 AM
|
#5
|
LQ Addict
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-15.0
Posts: 11,376
Rep: 
|
/usr/bin/java is probably not a jar file, but a directory or an executable binary file. You can check that with following command: And, remember that to look at a jar file's content you should use unzip, not java -jar.
|
|
1 members found this post helpful.
|
All times are GMT -5. The time now is 05:05 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|