1 Replies - 986 Views - Last Post: 27 August 2008 - 04:06 PM Rate Topic: -----

#1 dc333  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 24
  • Joined: 19-August 08

creating a directory inside a jar

Posted 27 August 2008 - 12:14 AM

Hi.

I'm creating a jar file using the following format:

jar cmf existing-manifest jar-file input-file(s)

The input file in my case is the class file, which is set in a certain package. There are two problems:

1. the package is called: my.package.util, meaning it has 3 directories and the class is under the util directory. I want to create the jar so that at the end of the process inside the jar file there'll be the three directories and under util the class file. Now i can get it so that under the jar there's the actual class or that there are a whole lot of directories starting from C:\... and ending with ..\my\package\util\the class file

2. currently i'm having no luck running the jar file (and yes, the manifest has a main-class header), so if anyone got ideas just how to make that happen i'll appreciate it :)

Should mention that everything is being done through another java program in the default package using the runtime.exec() method and not directly through the cmd.

Thanks.

Is This A Good Question/Topic? 0
  • +

Replies To: creating a directory inside a jar

#2 pbl  Icon User is offline

  • There is nothing you can't do with a JTable
  • member icon

Reputation: 8332
  • View blog
  • Posts: 31,857
  • Joined: 06-March 08

Re: creating a directory inside a jar

Posted 27 August 2008 - 04:06 PM

View Postdc333, on 27 Aug, 2008 - 12:14 AM, said:

Hi.

I'm creating a jar file using the following format:

jar cmf existing-manifest jar-file input-file(s)

The input file in my case is the class file, which is set in a certain package. There are two problems:

1. the package is called: my.package.util, meaning it has 3 directories and the class is under the util directory. I want to create the jar so that at the end of the process inside the jar file there'll be the three directories and under util the class file. Now i can get it so that under the jar there's the actual class or that there are a whole lot of directories starting from C:\... and ending with ..\my\package\util\the class file

2. currently i'm having no luck running the jar file (and yes, the manifest has a main-class header), so if anyone got ideas just how to make that happen i'll appreciate it :)

Should mention that everything is being done through another java program in the default package using the runtime.exec() method and not directly through the cmd.

Thanks.


cd to the directory containing the directory my and

jar cmf existing-manifest jar-file my

all the subs and their contents will follow and your manifest can reference my.package.util.mainClass

This post has been edited by pbl: 27 August 2008 - 04:08 PM

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1