• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 266
  • Last Modified:

can't run my application from prompt

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
thomas908
Asked:
thomas908
3 Solutions
 
girionisCommented:
The format.xml does not have to do with the classpath but with the path. How are you trying to load it?
0
 
TimYatesCommented:
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
 
thomas908Author Commented:
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
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
TimYatesCommented:
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
 
girionisCommented:
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
 
TimYatesCommented:
Actually, it could be:

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

But again, I'm just guessing...
0
 
armoghanCommented:
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
 
TimYatesCommented:
> Place the config dir in classes and then give the path

But it works in JBuilder...
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now