Posted on 2009-02-24
Last Modified: 2012-05-06
 I am working on standalone application using Netbeans. This is not web and desktop application
 This is java application
 I have created file and is created on the root of the source packages
 My system is not reading the file
 I have also tried it movong into the folder where main file exists
 But no luck. I donot wanted to hardcode path within the application
 The Error message says (The system cannot find the file specified)
       at Method)
       at mccprocesswatcher.Main.readRegistrationXMLs(
      at mccprocesswatcher.Main.main(

Please help me to fix this

Many Thanks
Properties properties = new Properties();

try {

	properties.load(new FileInputStream(""));

	String strPropertyValue = properties.getProperty("FtpDirectoryPath");"Property Read: "+strPropertyValue);

} catch (IOException e) {

    mL.error("Property file not read: " ,e);


Open in new window

Question by:tia_kamakshi
    LVL 86

    Accepted Solution

    Try the following. Place the file in the directory which is the parent of your package tree
    InputStream in = getClass().getResourceAsStream("/");

    Open in new window

    LVL 9

    Expert Comment

    If "" file is place at
    root of "compile class folder" then it should be fine.

    Author Closing Comment

    Many Many Thanks

    Featured Post

    Looking for New Ways to Advertise?

    Engage with tech pros in our community with native advertising, as a Vendor Expert, and more.

    Join & Write a Comment

    Suggested Solutions

    Title # Comments Views Activity
    SPLUNK REST  API call to Splunk to create and index? 2 42
    Fibonacci challenge 11 61
    java set up 1 37
    HashMap Vs TreeMap 12 32
    INTRODUCTION Working with files is a moderately common task in Java.  For most projects hard coding the file names, using parameters in configuration files, or using command-line arguments is sufficient.   However, when your application has vi…
    Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
    The viewer will learn how to implement Singleton Design Pattern in Java.
    This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.

    730 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

    16 Experts available now in Live!

    Get 1:1 Help Now