473,327 Members | 2,055 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 software developers and data experts.

problem with JAR command.

dmjpro
2,476 2GB
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
Mar 9 '08 #1
4 2422
JosAH
11,448 Expert 8TB
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
Mar 9 '08 #2
dmjpro
2,476 2GB
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
Mar 10 '08 #3
JosAH
11,448 Expert 8TB
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:

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
Mar 10 '08 #4
dmjpro
2,476 2GB
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(coammnd,null,current_working_director y);

Thanks JOS!

Debasis Jana.
Mar 10 '08 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

38
by: jrlen balane | last post by:
basically what the code does is transmit data to a hardware and then receive data that the hardware will transmit. import serial import string import time from struct import * ser =...
2
by: Xah Lee | last post by:
Python Doc Problem Example: os.system Xah Lee, 2005-09 today i'm trying to use Python to call shell commands. e.g. in Perl something like output=qx(ls) in Python i quickly located the...
3
by: Jagdip Singh | last post by:
Hi, We are facing problem accessing to DB2. Seems like database manager is down I tried starting it using db2start but it was neither showing any messages nor returning to command prompt...
2
by: Chris Bolus | last post by:
I'm a teacher using MS Access on an RMConnect 2.4 network. On some workstations both I and my students sometimes get an error message when attempting to insert a command button on a form which...
15
by: Ken Allen | last post by:
I have been developing a suite of assemblies over the past couple of weeks, and this afternoon somethign started misbehaving. If I do not run the IDE and compiler the code from the command line,...
7
by: WALDO | last post by:
I wrote a console application that basically consumes arguments and starts other command line apps via System.Process. Let's call it XCompile for now. I wrote a Visual basic add-in that does pretty...
0
by: Stewart Midwinter | last post by:
I have a Tkinter app running on cygwin. It includes a Test menu item that does nothing more than fetch a directory listing and display it in a Toplevel window (I'd use a tkMessageBox showinfo...
4
by: lynx_ace | last post by:
Hi everyone. I need a little bit help here...I have an assignment and it is working fine until the last part which I can't solve. So here's the code in simple form #define maxlength 200 ...
8
by: Ian Mackenzie | last post by:
Hi Guys I am VERY new to DB2 and have created a workingdays function to return the working days between 2 dates, but I get some compiler errors when running it: CREATE FUNCTION WORKINGDAYS...
12
by: Light | last post by:
Hi all, I posted this question in the sqlserver.newusers group but I am not getting any response there so I am going to try it on the fine folks here:). I inherited some legacy ASP codes in my...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.