Rollerball
Rollerball

Reputation: 13108

Dot in Classpath Declaration

I read that basically in order to activate the searching function in the current folder by using the command line javac -cp it's mandatory to specify a dot(.) as follows javac -cp . File.java. I noticed that if I omit the dot it works anyway. Has is it changed perhaps in the latest Java 7 updgrade?

Thanks in advance.

Upvotes: 1

Views: 387

Answers (1)

RudolphEst
RudolphEst

Reputation: 1250

By default the Java classpath will always contain the current folder as well as any jar files in ./lib/ even when you specify and empty classpath javac -cp File.java

I think it has been this way since Java 5.

Upvotes: 2

Related Questions