I'm using sun.net.www.protocol.http.ntlm.NTLMAuthenticationCallback
in a Java file.
The code builds and runs fine from Idea, but fails when using gradle compileJava.
I'm getting this error:
D:\source\msnavclient\MsNavClient.java:5: error: package sun.net.www.protocol.http.ntlm does not exist
import sun.net.www.protocol.http.ntlm.NTLMAuthenticationCallback;
^
D:\source\msnavclient\MsNavClient.java:20: error: cannot find symbol
NTLMAuthenticationCallback.setNTLMAuthenticationCallback(new NTLMAuthenticationCallback()
^
symbol: class NTLMAuthenticationCallback
location: class MsNavClient
D:\source\msnavclient\MsNavClient.java:20: error: cannot find symbol
NTLMAuthenticationCallback.setNTLMAuthenticationCallback(new NTLMAuthenticationCallback()
^
symbol: variable NTLMAuthenticationCallback
location: class MsNavClient
3 errors
I've found NTLMAuthenticationCallback
class is in jre/lib/rt.jar
, and tried adding the dependency directly in build.gradle
file, but the problem persist.
This is the build.gradle
file:
apply plugin: 'java'
repositories {
mavenCentral()
}
dependencies {
// compile files('C:\\Program Files\\Java\\jdk1.8.0_131\\jre\\lib\\rt.jar')
testCompile group: 'junit', name: 'junit', version: '4.12'
}
Can anybody help please?