Wildcards with --classpath parameter in CLI

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Wildcards with --classpath parameter in CLI

Ken Krugler
Hi all,

If I want to include all of the jars in a directory, I thought I could do --classpath file://<path to directory/*, the same as with the -cp option for a regular java program.

But this doesn’t seem to work. I believe it’s because JDK tools do the expansion before creating the URLs used by the classloader, but Flink code doesn’t do any such special processing, and just creates URLs - see ProgramOptions.java, via  classpaths.add(new URL(path));

Should I file an issue w/a patch? Or is there some reason to not support wildcards?

Thanks,

— Ken

--------------------------
Ken Krugler
+1 530-210-6378
custom big data solutions & training
Hadoop, Cascading, Cassandra & Solr



Reply | Threaded
Open this post in threaded view
|

Re: Wildcards with --classpath parameter in CLI

Till Rohrmann
Hi Ken,

I think it would be a good addition to support wildcards for the classpath option. That makes life much easier if you want to specify multiple jars to be included in the classpath. If you want to take the lead here, then it would be great :-)

Cheers,
Till


On Wed, Apr 27, 2016 at 6:43 AM, Ken Krugler <[hidden email]> wrote:
Hi all,

If I want to include all of the jars in a directory, I thought I could do --classpath file://<path to directory/*, the same as with the -cp option for a regular java program.

But this doesn’t seem to work. I believe it’s because JDK tools do the expansion before creating the URLs used by the classloader, but Flink code doesn’t do any such special processing, and just creates URLs - see ProgramOptions.java, via  classpaths.add(new URL(path));

Should I file an issue w/a patch? Or is there some reason to not support wildcards?

Thanks,

— Ken

--------------------------
Ken Krugler
<a href="tel:%2B1%20530-210-6378" value="+15302106378" target="_blank">+1 530-210-6378
custom big data solutions & training
Hadoop, Cascading, Cassandra & Solr




Reply | Threaded
Open this post in threaded view
|

Re: Wildcards with --classpath parameter in CLI

Ufuk Celebi
+1 :-)

On Wed, Apr 27, 2016 at 10:49 AM, Till Rohrmann <[hidden email]> wrote:

> Hi Ken,
>
> I think it would be a good addition to support wildcards for the classpath
> option. That makes life much easier if you want to specify multiple jars to
> be included in the classpath. If you want to take the lead here, then it
> would be great :-)
>
> Cheers,
> Till
>
>
> On Wed, Apr 27, 2016 at 6:43 AM, Ken Krugler <[hidden email]>
> wrote:
>>
>> Hi all,
>>
>> If I want to include all of the jars in a directory, I thought I could do
>> --classpath file://<path to directory/*, the same as with the -cp option for
>> a regular java program.
>>
>> But this doesn’t seem to work. I believe it’s because JDK tools do the
>> expansion before creating the URLs used by the classloader, but Flink code
>> doesn’t do any such special processing, and just creates URLs - see
>> ProgramOptions.java, via  classpaths.add(new URL(path));
>>
>> Should I file an issue w/a patch? Or is there some reason to not support
>> wildcards?
>>
>> Thanks,
>>
>> — Ken
>>
>> --------------------------
>> Ken Krugler
>> +1 530-210-6378
>> http://www.scaleunlimited.com
>> custom big data solutions & training
>> Hadoop, Cascading, Cassandra & Solr
>>
>>
>>
>