How to compress a bunch of .java files into a single .jar file?

Hello everyone! I am working on a Chinese segmentation job. Someone offers very excellent
such tool. When I copy his example, I find it imports
          import org.apache.lucene.analysis.Analyzer;
          import org.apache.lucene.analysis.Token;
          import org.apache.lucene.analysis.TokenStream;
          import org.mira.lucene.analysis.IK_CAnalyzer;I have downloaded IK_CAnalyzer.jar file which contains org.mira.lucene.analysis.IK_CAnalyzer class.
I find that I need to download lucene, thus I went into the following website
http://lucene.apache.org/#06+May+2008+-+Lucene+Java+2.3.2+availableand downloaded the lucene-2.3.2-src.tar.gz. Aftre unzip, I found all java source files in java directory (and in many other different subdirectories). Now it seems I need to compile all the src files and compress them into a single .jar file while keeping their original hierarchy unchanged
I think I should use jar command and with some additional options.
Can anyone show me how to do that?
Many thanks!
Edited by: aaron9979215 on Jul 12, 2008 5:17 AM

Thanks for reply, I?ve read that tutorial before I post. Howevver, it do tells how to compress a jar file.
The question I have is how to compile two .java file stored in different packages like
rootPackage-->subPackage-->a.java
rootPackage-->subPackage2-->b.java
I want to compile a,java and b.java both and keep their hierarchy like rootPackage.subPackage.a unchanged. If I directly go into subPackage and compile a.java, I think the hierarchy is changed.
What do you think about it?

Similar Messages

  • Compress two .jar file into a new .jar file

    Hi all, i would like to ask it there anyone know how to compress two or more .jar file into one new .jar file?
    because i'm currently need to engage with one big project which have to add 34 .jar file into JCreator, so that the relevant classes can be found when compile the code.
    another question is, what is the maximum archive can be add into JCreator? is it limited or unlimited?
    So, any idea from you all?
    Regards,
    poh_cc

    You should probably ask the authors of JCreator about the limitations of it.
    The classloader can't read jars from jars and I would advice against extracting all jars and jar all classes into one big fat jar.
    Kaj

  • How do i combine multiple pdf file into a single pdf file?

    how do i combine multiple pdf files into a single pdf file?

    The thread was started in early March and it's Mid-April, I know this very well. The OP of this thread posted a very common and simple question or maybe he/she would have resolved this. For an Adobe Acrobat user it's not at all difficult to combine multiple PDF files into one. But to combine PDF files full version of Adobe Acrobat is mainly required, otherwise PDF files can't be combined. For example, I'm using Adobe Acrobat 9 Pro. These simple steps are mainly required to combine PDF files:
    Open Adobe Acrobat.
    Click on Combine and click on Merge files into a single PDF.
    A window will be appearing, click on Add Files and select the PDF files you want to combine.
    Arrange the selected files in any order with the help of Move Up and Move Down button.
    Now click on Combine File and the selected PDF files will be combined within a few seconds.
    A new PDF file will be created. Click on Save As and name this new PDF file. Then, click on Save.
    A new PDF file will be created and all the selected PDF files are combined in it. The steps shown above might be different in other versions of Adobe Acrobat. Other than this, some third-party PDF merge software are also available. Most of them are available with a demo version for free evaluation. I've heard much about SysInfoTools PDF Merge software on other forums and directories and it's demo version is freely available. One may check its demo version if Adobe Acrobat (full version) is not available.
    Regards

  • Acrobat XI PRO: Create a Table of Contents (TOC) automatically in top, after I have combined several pdf.files into a single pdf.file

    Hey
    I have now tried for hours, but now I give up!
    MY WISH -
    Create a Table of Contents (TOC) automatically after I have combined several pdf.files into a single pdf.file.
    I have already bookmarks, shown on the screen (see screenshot below) but I want those bookmark to be visualised in a separate TOC in the top of the combined files.
    This new TOC (which I have inserted) shall be printable and serve as a cover page in a binder.
    I have seen other cheap pdf.programs in the market (e.g. PDF Converter Professional 7.3) which are able to make the above things, easy, fast and nice.
    Regards
    Ole Bünger, Kristianstad Sweden

    Somewhat roundabout way but this should work:
    Is there easy way to print bookmarks Acrobat Pro 9.5

  • Concatenate multiple pdf files into one single postscript file

    Hi,
    Could anyone help me with a code to "Concatenate Multiple pdf files into one single postscript file" ?
    Thanks for the help

    Thanks for your reply! Actually the main purpose is to allow user to select multiple pdf documents on a single web page and then he should be able to print all of them at once by hitting the print button on the web page instead of selecting each document seperately to print it. Also he should be able to see all the printing services available to print those documents.
    Thanks,

  • How Can I Convert Multiple TextEdit Files Into A Single Giant File?

    For example. I have multiple chapters for my new book each saved as individual files, and I want to combine all the chapters into one single continual file that I can work with in either Text Edit or Word. How can I do this? It's hundreds of files... ∆
    Thanks!

    Hi Bruce, Tex-Edit Plus for OS X...
    http://www.tex-edit.com/
    It can Merge files then Sort them easily, even has a remove duplicate lines script available.
    If the version you get doesn't have the sort perchance, here's a link, put sort in the search scripts box, get the second one, Sort Selection...
    http://dougscripts.com/texedit/

  • How to convert a multi page PDF document into a single TIF file?

    Hi!
    We are trying to convert a multi page PDF document into a single TIF file. We are using Adobe Acrobat Standard v 9. Can it be possible?

    I am also looking for feedback.  Although having a PDF copy of a document is wonderful, long term and efficient archival for my workplace is tif or tiff.
    Very frustrating that the PDF to tiff creates a separate tiff file for each page of the multi-page PDF document.  Are there any options or work-arounds?

  • Need help compiling external jar files into my one jar file from cmd line

    Here is my problem, let me see if I can explain it right:
    I am making a jar file on my development computer that will run my java project. In this java project, it references a couple Java3D jar files. On my development computer, I create the jar file and it runs correctly, but when I move that jar file over to the test computer, the parts of the application needing those Java3D jars are not found in my jar I created. I isolated the problem and it is because those Java3D jar files I needed are not on my test machine. But that is the way I need it to be. I need it so that when I compile all my code on the development machine, I need it to also compile those two Java3D files into my one jar that I move to the test machine. You get what I'm saying? I must do all the compiling from the command line and have only one jar file to put on the test machine that contains all my compiled code and the two Java3D files needed to run some of the applications in the project.
    Here a brief sample of what I'm doing:
    To compile my java files in my project, I simply to this for all my files:
    javac file.java
    javac file2.java... and so on for all my java files.
    Then I create my jar file:
    jar -cfm MyJar.jar manifest.mf file.class
    jar -fmu MyJar.jar manifest.mf file2.class... and so on for all my class files.
    Also when compiling my jar file, I do this thinking that it would include the two Java3D jars into my one jar file:
    jar -fmu MyJar.jar manifest.mf jars/j3d-org-images.jar
    jar -fmu MyJar.jar manifest.mf jars/j3d-org.jar
    My manifest file looks something like this:
    Manifest-Version: 1.0
    Main-Class: Main
    Class-Path: jars/j3d-org.jar jars/j3d-org-images.jar
    Do I have to have that Class-Path in there pointing to those jar files? Those jar files will not exist on my test machine because the directory structure will not be the same. I've tried a manifest without specifying my Class-Path to those jar files, but I get the same problem when I run my application on the part that needs the Java3D files.
    The error I am getting is that there is a RasterTextLabel class inside one of those Java3D jar files that my application cannot access because those jar files are not on my test machine.
    So basically what I really need to know is how I get those two Java3D jar files compiled into my one jar file that I move to a test machine and run with the following command:
    java -jar MyJar.jar
    Can anyone help me??
    Thanks.

    Here what you need is to have all the files present in a single jar file, and the classpath is set properly to the required jar files.
    Do the following in steps:
    1)
    Create a custom manifest file,say mymanifest.mf, with the following contenets, put it in current directory:
    Manifest-Version: 1.0
    Created-By: 1.4.0_01 (Sun Microsystems Inc.)
    main-Class: Main
    Class-Path: jars/j3d-org.jar jars/j3d-org-images.jar <press ENTER key>
    2)
    jar -cfm MyJar.jar manifest.mf file.class
    jar -fmu MyJar.jar manifest.mf file2.class... and so on for all class files.
    3)
    jar -fmu MyJar.jar manifest.mf jars/j3d-org.jar
    jar -fmu MyJar.jar manifest.mf jars/j3d-org-images.jar
    (Make sure that j3d-org-images.jar and j3d-org.jar are present in a subdirectory called 'jars')
    Now you would be able to run,
    java -jar myjar.jar

  • How to archive multiple outlook 2007 mail folders into a single archive file?

    I just migrated a client from Eudora (yeah ... I know ;-) to Outlook 2007.
    He has previously set up a folder within Eudora for each year's worth of old mail going back a number of years.
    I'd like to archive the oldest 5 years or so of mail into a single archive, but the manual archiving function in Outlook appears to want to create a separate archive file for each mail folder. Is there a way to select multiple folders and place them in a
    single archive or must I create archives for each folder and then open them back up in Outlook and merge them?
    Sorry, I'm sure this has been answered before, but I can't find it....

    Thank you Diane!
    I applied the registy update and it the (MANUAL) archive action still picks up no files....
    But .......... I've just discovered the "other" Eudora import problem with which I'm sure quite familiar ...
    HTML formatted e-mails being "converted" to almost unintelligible plain-text format....  :-(
    This is a pretty big deal to me and worth paying up for a solution ... I found the Aid4Mail and Stellar MBOX to PST products recommended on your company's website.
    I think I will be buying one or the other of them .........
    Do you think one is superior to the other?
    The PST file on my new machine is now ~1.5Gb populated with all the folders from my old Eudora account and LOTS of hosed up HTML  --> plaintext mail
    I have the PST in operation for other functions (calendar / Todo / iPhone sync). so would like to Delete all the "old" Eudora folders leaving just   "IN" and OUT and a bit more then have
    either Aid4Mail or MBOX2PST import the Eudora mail correctly into my existing PST file but I'm not sure that's a reasonable expectation...
    In "additional" expectations ... maybe these programs would import with correct time-stamps and fix my archiving issue also  ;-)  ?
    Thanks for any input... you are without a doubt the smartest person on the planet when it comes to Outlook, I've been following your work for many years!
    Jim

  • Combining 2+ WAV Files into a single WAV file

    Hello there,
    I am trying to combine at least 2 WAV files (my example uses 3) into a single file. I have tried several examples (http://www.jsresources.org/examples/AudioConcat.html and http://stackoverflow.com/questions/653861/join-two-wav-files-from-java) but both have the same problem: the output file is an exact copy of the last file to have been joined.
    Here is the code for the simpler of the 2 examples which I have altered to meet my needs.
            File outputFile = new File("concat.wav");
            for (int i = 0; i < files.length - 1; i++) {
                try {
                    AudioInputStream clip1 = AudioSystem.getAudioInputStream(files);
    AudioInputStream clip2 = AudioSystem.getAudioInputStream(files[i + 1]);
    AudioInputStream appendedFiles =
    new AudioInputStream(
    new SequenceInputStream(clip1, clip2),
    clip1.getFormat(),
    clip1.getFrameLength() + clip2.getFrameLength());
    AudioSystem.write(appendedFiles,
    AudioFileFormat.Type.WAVE,
    outputFile);
    files[i + 1] = outputFile;//first file read in next loop, will contain joined file so far
    } catch (Exception e) {
    e.printStackTrace();
    return outputFile;
    I am unsure as where the problem lies, so would be grateful for anyone to point out the (no doubt obvious) mistake i've made :p

    I don't see any problem with your actual code in terms of JavaSound, but...
    The first run through, you'd be concating "file1.wav" and "file2.wav" to a file called "concat.wav". The second time through, you'd be concating "concat.wav" and "file3.wav" to a file called "concat.wav"...
    On the second iteration, "concat.wav" will have a read-lock put on it until such time as the sequence input stream releases it... which will occur as soon as it's done reading it. At that point, the read lock is released and you can obtain a write-lock on it, but, you've already dumped all of the data from concat.wav into the bit bucket...so the only thing that gets to go in there now is "file3.wav".
    So, don't try to read from and write to the same file at the same time...

  • Combining Pages files into a single PDF file

    I have produced a 6 page quarterly newsletter (containing texts and images and printed on one 11x17 sheet and 1 8/5x11 sheet)) for a small volunteer organization (Friends of the Library). Separate files now have been extracted from my page-layout template.
    I now want to give them in a *single PDF flle* to the web master of our organization’s web page for posting in serial-order display.
    Nothing I’ve tried by way of cutting and pasting these files into any word processing document (preliminary to PDF-ing them) seems to work in any satisfactory way.
    What to do?

    Hi RHPC
    Welcome to the forum.
    You can combine pdfs in the Preview application.
    Just open them in Preview and open the thumbnail sidebars.
    +Menu > View > Sidebar+
    then drag the thumbnails into one pdf and resave that.
    Peter

  • How to compose two gif files into a single gif file?

    pls give me the direction , should i use the classes in swing or someone else?

    hello,
    this reply might be abit off but iam not sure about this in java but in c++ you can use the ImageProcessing library to do this.
    asrar

  • Creating jar file including 2 another jar files

    hi
    My project has java files, properties files,batch files as well as two jar files,mail.jar & activation.jar(for importing packages).
    I have to include these jar files while setting environment variables.
    Now i want to make "MyPrj.jar" file for myproject ,can anyone pls help me how to include these all files into a single jar file. and how to make setup file
    I have tried to extract out .class files of mail.jar & activation.jar & i ve created MyPrj.jar by including all class files(including class files of mail.jar & activation.jar) but manifest file(headers) are not added to MyPrj.jar.
    i have also tried to give mail.jar & activation.jar in Class-Path of menifest file, but it is also not working.
    Pls Help
    Thanks a lot

    [http://sourceforge.net/projects/one-jar]
    "One-JAR(TM) is a simple solution to a vexing problem in Java: how to distribute an application as a single jar-file, when it depends on multiple other jar-files. One-JAR uses a custom classloader to discover library jar files inside the main jar. "

  • CSV files to a single excel file

    Hi All!
    I would like to ask regarding the conversion of CSV files into a single Excel file.
    I am planning to combine all my 8 csv files into a single excel file being separted by sheets. each csv file will be converted in to a worksheet and be added to the excel workbook file.
    Any idea? I've heard about POI but i don't see any documentation for java beginners and simple example program that will convert CSV --> Worksheet and add that worksheet to an excel file.
    Thanx,
    MaDz

    http://forum.java.sun.com/thread.jspa?threadID=600161&messageID=3207453

  • Merging f4v files into a single file

    Hello All,
    Can I merge/ combine multiple f4v files into a single f4v file using Adobe premiere pro? If yes, can someone let me know the procedure? I am completely new to Premiere pro.
    Thanks in advance.
    Asavari

    Can I merge/ combine multiple f4v files into a single f4v file using Adobe premiere pro?
    Yes.
    Adding clips to sequences
    http://help.adobe.com/en_US/premierepro/cs/using/WS1c9bc5c2e465a58a91cf0b1038518aef7-7d27a .html
    Rearranging clips in a sequence
    http://help.adobe.com/en_US/premierepro/cs/using/WS1c9bc5c2e465a58a91cf0b1038518aef7-7d04a .html
    Exporting media using Adobe Media Encoder CS5, CS5.5, & CS6
    http://blogs.adobe.com/kevinmonahan/2012/04/23/exporting-media-using-adobe-media-encoder/
    Workflow and overview for exporting
    http://helpx.adobe.com/premiere-pro/using/workflow-overview-exporting.html
    Exporting with Adobe Media Encoder (video)
    http://tv.adobe.com/watch/learn-premiere-pro-cs5/exporting-with-adobe-media-encoder/
    I am completely new to Premiere pro.
    FAQ: How do I learn Premiere Pro?
    http://forums.adobe.com/thread/878529?tstart=0
    Getting Started with Premiere Pro CS6
    http://www.video2brain.com/en/getting-started-with-premiere-pro
    Adobe Premiere Pro Help and tutorials
    http://helpx.adobe.com/premiere-pro/topics.html
    Premiere Pro CS5-CS6 Reference
    (.pdf 12 MB download)
    http://helpx.adobe.com/pdf/premiere_pro_reference.pdf

Maybe you are looking for

  • Help me,About invoking PopUpManager.addPopUp problem in Flex 4 Module

    hello,when I invoke PopUpManager.addPopUp(),have a problem. detail from the fellowing program code; <?xml version="1.0" encoding="utf-8"?> <mx:Module xmlns:fx="http://ns.adobe.com/mxml/2009"            xmlns:s="library://ns.adobe.com/flex/spark" widt

  • Dumba*s newbie question :)

    So, I'm embarrassed to ask this but here goes... I've been having problems with Safari and figured that somehow it got corrupted. Therefore, I felt the best option was to get rid of Safari by moving it to the trash and downloading a new version from

  • Specific Internal Orders for general ledger code (expense)

    Hi at the time of data entry,  users enters ill logical internal orders , can we restrict them or provide them any list or object so that they can select specific internal orders for that general ledger. it will force them to use that internal orders

  • Regex for Java comments

    Hi everyone, Can anyone be so kind and post the simplest working regex pattern that matches all Java comments (multi-line, not in quoted strings, etc). I'm starting to use (Java) REs and have been fighting with various combinations of |s, $s, \\*s, P

  • MacBook display was replaced with an older one

    Hello, my MacBook (Early 2008) had a dark display. I brought it to an Apple Service Provider. Yesterday he replaced it with a new one. The problem is that my new display has less colors than the older one that was built in. It uses the dithering tech