I am using JCIFS (http://jcifs.samba.org/). My code is simple and taken from the Login.java example:
import jcifs.*;
import jcifs.smb.*;
public class netp {
public static void main( String argv[] ) throws Exception {
System.out.println("START");
String ip = "10.0.0.1";
String domain = "domain";
String user = "user";
String pass = "pass";
UniAddress dc = UniAddress.getByName( ip );
NtlmPasswordAuthentication auth = new NtlmPasswordAuthentication( domain + ";" + user + ":" + pass );
SmbSession.logon( dc, auth );
System.out.println("END");
return;
}
}
Compiling this works if I do this:
javac -cp jcifs-krb5-1.3.17.jar netp.java
However, if I run it like this:
java -cp jcifs-1.3.17.jar netp
I get:
Error: Could not find or load main class netp
What am I doing wrong?
I've uploaded the complete source code here:
https://www.box.com/s/po4frdmy0obqiroy9anp
Note: I am doing this all in Windows.