Click here to Skip to main content
15,896,421 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello can you please tell me how to modified (insert java file)the jar file .

and again make jar file

Thanks
Posted

What Jar file?

A jar without code is setup the way it is for a reason. One should not change that.

But one often can extend that by using the Jar-file as a library in the app one creates.
 
Share this answer
 
Comments
ravi1989h 8-Jan-13 6:37am    
Actually i have a jar file .i want to add some pluggin mean som e java file..how can it is possible..
TorstenH. 8-Jan-13 6:46am    
extend it. That's the official way.
Inoffical - a jar file is nothing lese than a zip file.
ravi1989h 8-Jan-13 6:38am    
jar file mean a library
You can update jar files by adding new classes, just check the options for the jar command:
C:\Users\Richard\Documents\Java>jar -?
Illegal option: ?
Usage: jar {ctxui}[vfm0Me] [jar-file] [manifest-file] [entry-point] [-C dir] files ...
Options:
    -c  create new archive
    -t  list table of contents for archive
    -x  extract named (or all) files from archive
    -u  update existing archive
    -v  generate verbose output on standard output
    -f  specify archive file name
    -m  include manifest information from specified manifest file
    -e  specify application entry point for stand-alone application
        bundled into an executable jar file
    -0  store only; use no ZIP compression
    -M  do not create a manifest file for the entries
    -i  generate index information for the specified jar files
    -C  change to the specified directory and include the following file
If any file is a directory then it is processed recursively.
The manifest file name, the archive file name and the entry point name are
specified in the same order as the 'm', 'f' and 'e' flags.

Example 1: to archive two class files into an archive called classes.jar:
       jar cvf classes.jar Foo.class Bar.class
Example 2: use an existing manifest file 'mymanifest' and archive all the
           files in the foo/ directory into 'classes.jar':
       jar cvfm classes.jar mymanifest -C foo/ .
 
Share this answer
 
Comments
ravi1989h 8-Jan-13 7:00am    
thanks sir but i am beginner i am not able to under stand can you please elaborate .i have cordova.2.0.0.jar file .and having BarcodeScanner.java Encoder.java
Richard MacCutchan 8-Jan-13 7:13am    
Well you need to explain what you are trying to do that cannot be done with the information I have provided.
ravi1989h 8-Jan-13 9:29am    
actually i want to modified jar file (add plugin). can you please check this link.
https://github.com/phonegap/phonegap-plugins/tree/master/BlackBerry/BarcodeScanner
Richard MacCutchan 8-Jan-13 11:09am    
Sorry, but I cannot read through all the information on that site in order to try and guess what you are trying to do. Unless you can explain exactly what you are trying to add or otherwise change in whatever jar file you are working with, then it is very difficult to offer any useful advice.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900