473,413 Members | 1,795 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,413 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 2425
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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...

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.