How can I decompress lzh file in Java?

I got an lzh file, and i want to decompress it in my Java program.
How can I do it?
Thanks.

I don't know if any software exists for this in Java. It is certainly not part of the JDK.
The LZH format is described here: http://www.osirusoft.com/joejared/lzhformat.html
If you want you could write your own LZH decompressor.
Jesper

Similar Messages

  • How can we open any file using JAVA...

    Hi all
    i trying to make code in that code i choose a file using a filechooser then put that file name in FILE object like (File file = fileChooser.getSelectedFile();)
    but the thing is how can i open that file for example if that file is HTML file then opens in IE or if that file is MS Word document that open in Word, like that
    is there any suggestions
    Thanx
    Regards
    Satinderjit

    start is a windows command-line utility.
    start foo.doc will start Word (or Star Office or Word Perfect or whatever is registered for the .doc extension),
    start bar.htmnl will start your registered browser etc.

  • How can i put Jar Files in Java Runtime.?

    HI,
    how can i put jar files in JRE so that they are accessible every where.? is there some way.?
    Regards,
    AA

    Closest you could get to this I think is to explode all your jars into the same parent directory. Then if you put that directory on the classpath, you should be able to access all classes in all jar files

  • How can i import dll files in java project in eclipse?

    Hi All,
    How can i import or link dll files in java project in eclipse?....
    dll files contains
    import com.ms.com.ComLib;
    import com.ms.com.Variant;
    import com.ms.com.ComFailException;
    import com.ms.wfc.data.AdoException;
    import com.ms.wfc.data.AdoEnums;
    Any idea of this please tell me.....
    I am using eclipse 3.4 and JRE 1.4
    Is this possible?
    Please tell me!!!!!!!!!!!!!
    Voddapally

    iMovie cannot edit mpg files, unles they come directly from a supported camera.
    I would suggest that you use a free third party app to convert it.
    Get MPEG Streamclip from Squared 5, which is free.
    Drag you mpg clip into MPEG Streamclip.
    Then, FILE/EXPORT USING QUICKTIME
    Choose Apple Intermediate Codec, and save it where you can find it. You should be able to import this file into iMovie, using the FILE/IMPORT/MOVIE command.
    Note: If your file is an MPEG2 clip, you may need to purchase the Apple QuickTime MPEG2 Playback Component from Apple. MPEG Streamclip will tell you if you need this. Don't buy it unless you have to. It costs about $20. You just have to install the component. MPEG Streamclip will use it in the background.

  • How can I call .exe file in java

    Hello,
    I want to call excutable files(.exe) in my java source code. How can I use the excutable files in java code.
    Thanks.
    Robin

    See java.lang.Runtime.exec()

  • How can i convert  Javscript file to Java class file...?

    Hi,
    Actually in my project, JavaScript code will be given in text box and now I have evaluate the code and i have to create a class file for it. Till evaluating the JavaScript is done by using Javax.script package... but i don't now how to create a class file for the evaluated JavaScript code..
    Can any one help me on this issue....

    As has been mentioned Adobe Reader cannot export PDF page content. Nor can it create PDF or manipulate PDF page content.
    What you can do is use one of Adobe's online subscription services. Two provide for PDF  to Word export.
    There's ExportPDF and PDF Pack.
    Be well...

  • Urgent !! How can I create pdf file in java ?

    Hello all...Respected sir/mam
    I have written a servlet in which it makes the connectivity with the database(mysql) and then draws the values from the database ..now i want to write that values into a pdf file...I used the FileWriter class and wrote that pdf..Now when I run the application the pdf was created but I was unable to open it directly in Acrobat...I opened it in notepad then it showed me all the data from the database...? What might be the problem ? Is it that my acrobat reader is not correctly installed or some settings need to be made in my application so that it can be read using acrobat reader..?
    Please help me ..
    Thanks ..

    Hi!
    Try using apache fop. If you are familiar with xml and xslt it is fairly easy to write some database records into a table in an pdf file. Have a look at http://xml.apache.org/fop/index.html
    Cheers,
    Steffen

  • How to read an ARPA file in java

    Hi
    Im new in java and dont know many thing about it, I want to know how can read an ARPA file in java.
    pleas describ it step bye step and esy to understand.
    Edited by: 836719 on Feb 14, 2011 8:15 PM

    836719 wrote:
    ok i explain what i want to do maybe u can help me more,
    i want to read an arpa file and search it to find for example a word.so u think which method that u mentioned above is beter???
    It will be pleasure if u have any tip that can help me.1. Learn the basics of programming as well as how to logically construct and deconstruct a problem domain.
    2. Learn the basics of programming java.
    3. Learn about java.io.*
    4. Learn about java swing
    5. Find documentation that describes the format of the ARPA file.
    6. Read the documentation and understand it.
    7. Find a source for ARPA files (if this is online then there is more java to learn as well.)
    8. Use 1,2 and 3 to write java code that consumes the ARPA file.
    9. Use 4 to ask the user for a word.
    10. Use 1 and 2 to write code that 'searches' what you read in 8.

  • How I can create a XML file from java Aplication

    How I can create a XML file from java Aplication
    whith have a the following structure
    <users>
    <user>
    <login>anyName</login>     
    <password>xxxx</password>
    </user>
    </users>
    the password label must be encripted
    accept any suggestion

    Let us assume you have all the data from the jsp form in an java bean object..
    Now you want a xml file. This can be acheived in 2 ways
    1. Write it into a file using java.io classes. Say you have a class with name
    write("<name>"+obj.getName+</name>);
    bingo you have a flat file with the xml
    2. Use data binding to do the trick
    will recommend JiBx and Castor for the 2nd option
    Regards,
    Rajagopal

  • How can i build RPMs file for my own Java Application?

    How can i build RPMs file for my own Java Application?....I have my own directory that contains all Java Source files and some files that my Application required....I want to build RPMs file like a install File to Linux System, Now my OS is Linux Fedora core 1.....How can i do this?

    I think that in order to create a RPM, you'd need to
    use some C.Nope - the RPM is all about packaging and the "magic" x.spec file. You can have anything you want in the RPM, but you have to use RPM tools to build the .rpm file. One of the features is that you can also indicate (via "install" scripts) modifications to other files or the filesystem to support the installation of whatever's in the RPM.

  • How can i wrote configuration file in Log4j

    iam new log4j .i have seen one small programme in log4j examples folder ..i e. shown below
    Sort.java
    =====
    package examples;
    import org.apache.log4j.PropertyConfigurator;
    import org.apache.log4j.Logger;
    import org.apache.log4j.Priority;
    Example code for log4j to viewed in conjunction with the {@link
    examples.SortAlgo SortAlgo} class.
    <p>This program expects a configuration file name as its first
    argument, and the size of the array to sort as the second and last
    argument. See its <b>source
    code</b> for more details.
    <p>Play around with different values in the configuration file and
    watch the changing behavior.
    <p>Example configuration files can be found in <a
    href="doc-files/sort1.properties">sort1.properties</a>, <a
    href="doc-files/sort2.properties">sort2.properties</a>, <a
    href="doc-files/sort3.properties">sort3.properties</a> and <a
    href="doc-files/sort4.properties">sort4.properties</a> are supplied with the
    package.
    <p>If you are also interested in logging performance, then have
    look at the {@link org.apache.log4j.performance.Logging} class.
    @author Ceki G&uuml;lc&uuml; */
    public class Sort {
    static Logger logger = Logger.getLogger(Sort.class.getName());
    public static void main(String[] args) {
         if(args.length != 2) {
              usage("Incorrect number of parameters.");
         int arraySize = -1;
    try {
              arraySize = Integer.valueOf(args[1]).intValue();
              if(arraySize <= 0)
                   usage("Negative array size.");
    catch(java.lang.NumberFormatException e) {
    usage("Could not number format ["+args[1]+"].");
    PropertyConfigurator.configure(args[0]);
    int[] intArray = new int[arraySize];
    logger.info("Populating an array of " + arraySize + " elements in" +" reverse order.");
    for(int i = arraySize -1 ; i >= 0; i--) {
              intArray[i] = arraySize - i - 1;
    SortAlgo sa1 = new SortAlgo(intArray);
    sa1.bubbleSort();
    sa1.dump();
    // We intentionally initilize sa2 with null.
    SortAlgo sa2 = new SortAlgo(null);
    logger.info("The next log statement should be an error message.");
    sa2.dump();
    logger.info("Exiting main method.");
    static void usage(String errMsg) {
         System.err.println(errMsg);
         System.err.println("\nUsage: java org.apache.examples.Sort " + "configFile ARRAY_SIZE\n"+
    "where configFile is a configuration file\n"+" ARRAY_SIZE is a positive integer.\n");
    System.exit(1);
    and
    SortAlgo.java
    ==========
    package examples;
    import org.apache.log4j.Category;
    import org.apache.log4j.NDC;
    Example code for log4j to viewed in conjunction with the {@link
    examples.Sort Sort} class.
    <p>SortAlgo uses the bubble sort algorithm to sort an integer
    array. See also its <b>source
    code</b>.
    @author Ceki G&uuml;lc&uuml; */
    public class SortAlgo {
    final static String className = SortAlgo.class.getName();
    final static Category CAT = Category.getInstance(className);
    final static Category OUTER = Category.getInstance(className + ".OUTER");
    final static Category INNER = Category.getInstance(className + ".INNER");
    final static Category DUMP = Category.getInstance(className + ".DUMP");
    final static Category SWAP = Category.getInstance(className + ".SWAP");
    int[] intArray;
    SortAlgo(int[] intArray) {
    this.intArray = intArray;
    void bubbleSort() {
    CAT.info( "Entered the sort method.");
    for(int i = intArray.length -1; i >= 0 ; i--) {
    NDC.push("i=" + i);
    OUTER.debug("in outer loop.");
    for(int j = 0; j < i; j++) {
         NDC.push("j=" + j);
         // It is poor practice to ship code with log staments in tight loops.
         // We do it anyway in this example.
         INNER.debug( "in inner loop.");
    if(intArray[j] > intArray[j+1])
         swap(j, j+1);
         NDC.pop();
    NDC.pop();
    void dump() {   
    if(! (this.intArray instanceof int[])) {
    DUMP.error("Tried to dump an uninitialized array.");
    return;
    DUMP.info("Dump of integer array:");
    for(int i = 0; i < this.intArray.length; i++) {
    DUMP.info("Element [" + i + "]=" + this.intArray);
    void swap(int l, int r) {
    // It is poor practice to ship code with log staments in tight
    // loops or code called potentially millions of times.
    SWAP.debug( "Swapping intArray["+l+"]=" + intArray[l] +
         " and intArray["+r+"]=" + intArray[r]);
    int temp = this.intArray[l];
    this.intArray[l] = this.intArray[r];
    this.intArray[r] = temp;
    This program expects a configuration file name as its first
    argument, and the size of the array to sort as the second and last
    argument. See its <b>source
    code</b> for more details.
    please help me how can write that configuration file
    thanks

    Hi bala,
    check that log4j manual I pointed to in yer previous thread.
    This is a pot-boiler config file... Copy it into some file say "props.conf" and use it.
    # Set root logger level to DEBUG and its only appender to A1.
    log4j.rootLogger=DEBUG, A1
    # A1 is set to be a ConsoleAppender.
    log4j.appender.A1=org.apache.log4j.ConsoleAppender
    # A1 uses PatternLayout.
    log4j.appender.A1.layout=org.apache.log4j.PatternLayout
    log4j.appender.A1.layout.ConversionPattern=%-4r [%t] %-5p %c %x - %m%nCheers,

  • How can I remove a file on server w/ my JSP app running on Tomcat 7 ?

    First of all, I'm posting here because I found it the closest to java web development in the forums listing.
    How can I remove a file on the server side with my JSP app running on Tomcat 7 ? I did it in a JSE app by changing permissions, but how can I do it for a simple JSP app ?
    My code is
    public static void excluirArquivos(String nomeArquivoExcluido) {
              File arquivoExcluido = new File (nomeArquivoExcluido);
              arquivoExcluido.setWritable(true, true);
              SecurityManager sm = new SecurityManager();
              try {
                   sm.checkDelete(arquivoExcluido.getAbsolutePath());
                   System.gc();
                   if (arquivoExcluido.delete()) System.out.println("File '" + nomeArquivoExcluido + "' successfully removed.");
                   else System.out.println("File '" + nomeArquivoExcluido + "' wasn't removed somehow.");
              } catch (SecurityException se) {
                   System.out.println("File '" + nomeArquivoExcluido + "' can't be excluded. There is no permissions.");
         }And it always falls on the catch statement.

    899238 wrote:
    How can I remove a file on the server side with my JSP app running on Tomcat 7 ? I did it in a JSE app by changing permissions, but how can I do it for a simple JSP app ?1. make sure that the JVM has the (filesystem) rights to be able to remove said file
    2. make sure the file is in fact not locked (for example, opened by another process)
    3. use File.delete()
    There is no guarantee that you can delete a file, you can only make an attempt. There can be any number of reasons, most if not all of them not related to code, that the deletion of a file does not work.

  • How can I set a file to hidden

    Hi all
    How can I set a file to hidden from within Java.
    This is what I have tried so far but with out any luck
        String[] cmd = new String[3];
        cmd[0] = "cmd.exe";
        cmd[1] = "attrib +h";
        cmd[2] = "\""+"C:/program files/Licence.xml"+"\"";
        Runtime rt = Runtime.getRuntime();
        Process proc = rt.exec(cmd);Thanks
    Craig

    Try
    cmd[0] = "attrib"
    cmd[1] = "+h"
    cmd[2] = "C:\Program Files\Licence.xml"
    You may need to double the baskslashes
    Is the spelling of "Licence" correct?

  • How to call a .bat file from java code?

    How to call a .bat file from java code? and how can i pass parameters to that .bat file?
    Thanks in advance

    thanks for ur reply
    but still i am getting the same error.
    I am trying to run a .bat file of together tool, my code looks like below
    import java.lang.Runtime;
    import java.lang.Process;
    import java.io.File;
    class SysCall{
         public static void main(String args[]){
              String cmd="D://Borland//Together6.2//bin//Together.bat -script:com.togethersoft.modules.qa.QA -metrics out:D://MySamples//Metrics// -fmt:html D://Borland//Together6.2//samples//java//CashSales//CashSales.tpr";
              //String path="D://Borland//Together6.2//bin//Together.bat ";
              Runtime r= Runtime.getRuntime(); //Declare the system call
              try{
                   System.out.println("Before batch is called");
                   Process p=r.exec(cmd);
                   System.out.println(" Exit value =" + p.exitValue());
                   System.out.println("After batch is called");
              /*can produce errors which must be caught*/
              catch(Exception e) {
                   e.printStackTrace();
                   System.out.println (e.toString());
    I am getting the below exception
    Before batch is called
    java.lang.IllegalThreadStateException: process has not exited
    at java.lang.Win32Process.exitValue(Native Method)
    at SysCall.main(SysCall.java:17)
    java.lang.IllegalThreadStateException: process has not exited

  • HOw to create a Batch file for java application and whats the use of this ?

    HI,
    How to create a Batch file for java application ?
    And whats the use of creating batch file ?
    Thanks in advance

    First of all, you're OT.
    Second, you can find this everywhere in the net.
    If you got a manifest declaring main class (an classpath if needed), just create a file named whatever.bat, within same directory of jar file, containing:
    javaw -jar ./WhateverTheNameOfYourJarIs.jar %*By the way, assuming a Windows OS, you can just double click the jar file (no batch is needed).
    Otherwise use:
    javaw -cp listOfJarsAndDirectoriesSeparedBySemiColon country/company/application/package/className %*Where 'country/company/application/package/' just stands for a package path using '/' as separator instead of '.'
    Don't specify the .class extension.
    Javaw only works on Windows (you asked for batch, I assumed .BAT, no .sh), in Linux please use java.exe (path may be needed, Windows doesn't need it 'cause java's executables are copied to system32 folder in order to be always available, see PATH environment variable if you don't know what I'm talking about) and use ':' as classpath (cp) separator.
    The '%***' tail is there in order to pass all parameters, it only works on Windows, refer to your shell docs for other OSs (something like $* may work).
    This way you have a command you can call to launch your code (instead of opening NetBeans just to see your app working). You could schedule tasks on it or just call it in any command prompt (hope you know what it is 'cause there have been people in this very same forum with no clue about it, if not just hold the 'Windows button' and press 'R', then type 'cmd' and run it).
    Finally add dukes and give 'hem away.
    Bye.

Maybe you are looking for