// accessing a resource with getResource to give you its URL URL url = Entities.class.getResource( "entitytable.ser" ); out.println( url ); // Note that getResource is an instance method of Class, // so You CANNOT say: URL url = Class.getResource( "entitytable.ser" );