Solved

can't run my application from prompt

Posted on 2004-09-01
8
218 Views
Last Modified: 2010-04-16
i have the following directory structrute

E:\testing\src\classes : contains class files as  com.dt.m.min.App
E:\testing\src : contains jar files(conf.jar, log4j-1.2.7.jar etc)

I am trying to run my application as follows

E:\Testing\src>java -classpath classes;log4j-1.2.7.jar;mysql-connector-java-3.0.6-stable-bin.jar;conf.jar;datasocket.jar;.; com.dt.m.min.App

But keep getting the follwoing error

log4j:ERROR Could not open [conf\format.xml].
java.io.FileNotFoundException: conf\format.xml (The system cannot find the path
specified)

I have set my classpaths properly, why is this happening
0
Comment
Question by:thomas908
8 Comments
 
LVL 35

Accepted Solution

by:
girionis earned 45 total points
ID: 11951629
The format.xml does not have to do with the classpath but with the path. How are you trying to load it?
0
 
LVL 35

Assisted Solution

by:TimYates
TimYates earned 40 total points
ID: 11951641
Are you using back slashes in your code where you reference format.xml?

Try

  "/conf/format.xml"

assuming format.xml is inside a directory "conf" inside one of your jar files ;-)
0
 
LVL 8

Author Comment

by:thomas908
ID: 11951899
I am using

 DOMConfigurator.configure("conf\\format.xml");

on windows.
It runs perfectly fine when i run from JBUIlder but problem is coming from prompt
0
 
LVL 35

Expert Comment

by:TimYates
ID: 11951927
Try:

    DOMConfigurator.configure("conf/format.xml");

Where is the format.xml file?  in the conf.jar?

Is it in a folder in the conf.jar?

if not, try:

    DOMConfigurator.configure( "/format.xml" );
0
Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

 
LVL 35

Expert Comment

by:girionis
ID: 11951941
Folder separators shouldn't matter tbh. But Tim is right, we need to know the location of the file in order to help you.
0
 
LVL 35

Expert Comment

by:TimYates
ID: 11951981
Actually, it could be:

DOMConfigurator.configure( "/conf/format.xml" );

But again, I'm just guessing...
0
 
LVL 18

Assisted Solution

by:armoghan
armoghan earned 40 total points
ID: 11952133
actually JBuilder makes the project directory as root directory.. and src, classes and conf dir are inside it and they would all be on the same level.

Place the config dir in classes and then give the path

DOMConfigurator.configure( "conf/format.xml" );

0
 
LVL 35

Expert Comment

by:TimYates
ID: 11952177
> Place the config dir in classes and then give the path

But it works in JBuilder...
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.
This video teaches viewers about errors in exception handling.

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now