Sponsored Content
Top Forums UNIX for Beginners Questions & Answers Getting the version from jar file Post 303006040 by nextStep on Friday 27th of October 2017 02:15:32 AM
Old 10-27-2017
1. Subdirectory under META-INF have many packages
2. File is getting extracted as per the below output

Apparently , modified the above command by omitting the colon(Smilie symbol as below and the result is having another keyword Implementation-Version outputting in the terminal,again i have to forcefully terminate the command. Will this could be the issue?

Code:
find /usr/local/platform  -name "platform.jar" -exec zipgrep "Implementation-Version" '{}' \;|awk -F ': ' '{print $2}'

Code:
2.9.0-29
                           <Implementation-Version>${project.version}</Implementation-Version>

---------- Post updated 10-27-17 at 01:15 AM ---------- Previous update was 10-26-17 at 07:51 AM ----------

After some research i modified the script which gets the required information and shell is exiting normally. Thanks

Code:
jpath=/home/user/dropbox/platform.jar
unzip -q -c $jpath META-INF/MANIFEST.MF | grep 'Implementation-Version' | cut -d ':' -f2>>testversion.txt

Output
2.9.0-29
 

8 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Jar File Search!

Hi vgersh99, Iam sorry for that. In future, I will start new threads for different topics. Assuming that we don't know what the name of the jar file, we are searching for is, do we have any way, of finding a string or a file in it. Is there any Unix command for it? thanks. (2 Replies)
Discussion started by: pjanakir
2 Replies

2. UNIX for Dummies Questions & Answers

down in JAR file

Hello sir, I have created a jar file having some code in java.What it does is that it calls a shell code (a.sh) which is in the same directory. Now my requirement is that I want to jar the a.sh also along with the other files and want to call the a.sh which is now inside the jar file and not... (1 Reply)
Discussion started by: nsharath
1 Replies

3. Shell Programming and Scripting

calling jar file from ksh

Hi, I have a below command in ksh .... $JAVA_HOME/bin/java -cp "/usr/orabase/product/10.2.0/lib:/usr/java/javajar/common/sched.jar:/usr/orabase/product/10.2.0/jdbc/lib/ojdbc14_g.jar:/usr/orabase/product/10.2.0/jdbc/lib/classes12.jar" com.abrt.smart.Smart I want to know where the... (1 Reply)
Discussion started by: PRKS
1 Replies

4. Ubuntu

Add external Jar file

Hi, how to add external jar file in jsp application on eclipse. Thanks SN:confused: (0 Replies)
Discussion started by: snallusami
0 Replies

5. Programming

How can this jar file open pdf ??

OKay so my question is that how does this jar file convert something in there and show pdf when open it? I don't get how it works. Can someone explain to me. I have a link below, in there will be a file call Tools, and please open the file called "PQ10-sample" it will automaticly open up a pdf as... (11 Replies)
Discussion started by: tonyduong15
11 Replies

6. Shell Programming and Scripting

Want to write all the jar name in single with delimiter ":" in beween the jar name

Hi All, I am having 7 jar files in a dir. abc like listed below bash-3.00$ cd abc bash-3.00$ ls 123.jar 23wdawd.jar dfsa23.jar dsa.jar wew234.jar adsd234234.jar dfsda423.jarNow i want to assign all this jar files to a variable in the below format ... (6 Replies)
Discussion started by: natraj005
6 Replies

7. Shell Programming and Scripting

Copy a file from directroy/ prior version to the directory/ new version

How to copy a file from directroy/ prior version to the directory/ new version automatically. (4 Replies)
Discussion started by: roy1912
4 Replies

8. Programming

Altering a jar file

I have a script I am trying to test and run but it runs against a jar file. I wrote an external property file so it would redirect with my script, but it keeps going in search of the previous property file. Is there any way to externally over write the jar file and if not how do you go about... (7 Replies)
Discussion started by: risarose87
7 Replies
FASTJAR(1)								GNU								FASTJAR(1)

NAME
fastjar - archive tool for Java archives SYNOPSIS
fastjar -ctxu [OPTIONS] [jar-file] [manifest-file] [-C dir] files... DESCRIPTION
"fastjar" is an implementation of Sun's jar utility that comes with the JDK, written entirely in C, and runs in a fraction of the time while being feature compatible. If any file is a directory then it is processed recursively. The manifest file name and the archive file name needs to be specified in the same order the -m and -f flags are specified. OPTIONS
Exactly one of the following actions must be specified: -c Create new archive. -t List table of contents for archive. -x Extract named (or all) files from archive. -u Update existing archive. The following parameters are optional: -@ Read the names of the files to add to the archive from stdin. This option is supported only in combination with -c or -u. Non standard option added in the GCC version. -C directory Change to the directory and include the following file. -E Prevent fastjar from reading the content of a directory when specifying one (and instead relying on the provided list of files to populate the archive with regard to the directory entry). Non standard option added in the GCC version. -M Do not create a manifest file for the entries. -i Generate an index of the packages in this jar and its Class-Path. -J All options starting with -J are ignored. -0 Store only; use no ZIP compression. -V --version Display version information. -f archive Specify archive file name. -m manifest Include manifest information from specified manifest file. -v Generate verbose output on standard output. Parameters of the form @option{@}FILE are considered to be names of files, and are expanded with the contents of the file. All remaining options are considered to be names of files. SEE ALSO
gcj(1), gij(1), grepjar(1) and the Info entry for gcj. COPYRIGHT
Copyright (C) 2002, 2007, 2008 Matthias Klose Permission is granted to copy, distribute and/or modify this document under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. A copy of the license is included in the man page gfdl(7). 0.97 2008-10-16 FASTJAR(1)
All times are GMT -4. The time now is 05:05 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy