problem with JAR command.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • dmjpro
    Top Contributor
    • Jan 2007
    • 2476

    problem with JAR command.

    jar -cf warfilename fulabsolutepath .
    It's working perfect but the problem is .... suppose the absolute path is "d:\sample\web" , now what happens that the folder structure is being created ....
    d:->sample->web->WEB-INF ......
    and the root files located in web.
    But i want like .....
    WEb-INF->..........
    and the root files located in web.

    How could I do that?

    Debasis Jana
  • JosAH
    Recognized Expert MVP
    • Mar 2007
    • 11453

    #2
    Originally posted by dmjpro
    jar -cf warfilename fulabsolutepath .
    It's working perfect but the problem is .... suppose the absolute path is "d:\sample\web" , now what happens that the folder structure is being created ....
    d:->sample->web->WEB-INF ......
    and the root files located in web.
    But i want like .....
    WEb-INF->..........
    and the root files located in web.

    How could I do that?

    Debasis Jana
    So why don't you structure your subdirectories in such a way that they reflect
    the structure you want in your WEB-INF directory? You can simply jar them all
    then in one single sweep. If is ridiculous to expect the jar tool to untangle and
    rearrange stuff into the correct structure.

    kind regards,

    Jos

    Comment

    • dmjpro
      Top Contributor
      • Jan 2007
      • 2476

      #3
      Originally posted by JosAH
      So why don't you structure your subdirectories in such a way that they reflect
      the structure you want in your WEB-INF directory? You can simply jar them all
      then in one single sweep. If is ridiculous to expect the jar tool to untangle and
      rearrange stuff into the correct structure.

      kind regards,

      Jos

      I managed to do that.
      Suppose my web dir is in d:\sample\web
      First I change the working directory to d:\sample\web.
      Then I run the jar command ..like .....

      jar -cf something.war .

      It's Working fine .......
      But I want to do it programaticaly using Runtime.exec().
      So how can I change the working directory in Java.
      I tried with "cd" command but it fails ....

      How could I do Jos????

      Debasis Jana

      Comment

      • JosAH
        Recognized Expert MVP
        • Mar 2007
        • 11453

        #4
        Originally posted by dmjpro
        I managed to do that.
        Suppose my web dir is in d:\sample\web
        First I change the working directory to d:\sample\web.
        Then I run the jar command ..like .....

        jar -cf something.war .

        It's Working fine .......
        But I want to do it programaticaly using Runtime.exec().
        So how can I change the working directory in Java.
        I tried with "cd" command but it fails ....

        How could I do Jos????

        Debasis Jana
        Straight from the API docs for the File class:

        Originally posted by File API
        A pathname, whether abstract or in string form, may be either absolute or relative. An absolute pathname is complete in that no other information is required in order to locate the file that it denotes. A relative pathname, in contrast, must be interpreted in terms of information taken from some other pathname. By default the classes in the java.io package always resolve relative pathnames against the current user directory. This directory is named by the system property user.dir, and is typically the directory in which the Java virtual machine was invoked.
        kind regards,

        Jos

        Comment

        • dmjpro
          Top Contributor
          • Jan 2007
          • 2476

          #5
          Originally posted by JosAH
          Straight from the API docs for the File class:



          kind regards,

          Jos

          I managed to do that by specifying the current working directory in the third parameter.
          Runtime.exec(co ammnd,null,curr ent_working_dir ectory);

          Thanks JOS!

          Debasis Jana.

          Comment

          Working...