4 Replies Latest reply: Jul 13, 2008 6:20 AM by 592250 RSS

    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
      and 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