Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

error in opening zip file

 
Amirtharaj Chinnaraj
Ranch Hand
Posts: 241
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi guys

i tried to load a properties file form

classpath using classloader

by using the following code


import java.net.URI;

class prop
{
public static void main(String as[])
{

try{

ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
URI path= (classLoader.getResource("test.properties").toURI());
System.out.println( " path: " + path );
}

catch(Exception ex)
{
System.out.println("erro " +ex) ;

}

}


}

but i end up in error
like. i have set the classapath properly
error: error reading D:\properties\test.properties; error in opening zip file

regards
amir
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic