Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8688747
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T23:27:15+00:00 2026-06-12T23:27:15+00:00

I am using JCIFS (http://jcifs.samba.org/). My code is simple and taken from the Login.java

  • 0

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.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T23:27:16+00:00Added an answer on June 12, 2026 at 11:27 pm

    It seems that your myJavaApp class is in some package and you have omitted the package name in addition to not setting class path at all.

    My directory structure for testing:

    .
    \--- jcifs-1.3.17.jar
    \--- testapp
         \--- myJavaApp.java  
    

    I compiled it like this:

    javac -cp jcifs-1.3.17.jar testapp/myJavaApp.java
    

    which gave myJavaApp.class in testapp folder as expected. I have run it on linux like this:

    java -cp .:jcifs-1.3.17.jar testapp.myJavaApp
    

    and on windows like this:

    java -cp .;jcifs-1.3.17.jar testapp.myJavaApp
    

    It throwed

    jcifs.util.transport.TransportExceptionjava
    java.net.NoRouteToHostException: No route to host
    

    which means that the myJavaApp had run succesfully.

    If we remove the testapp directoy, e.g.

    .
    \--- jcifs-1.3.17.jar
    \--- myJavaApp.java 
    

    it compiles with:

     javac -cp jcifs-1.3.17.jar myJavaApp.java
    

    and on linux runs with:

    java -cp .:jcifs-1.3.17.jar myJavaApp
    

    for windows

    java -cp .;jcifs-1.3.17.jar myJavaApp
    

    EDIT:

    all java[c] commands were run from root(.) / testing directory

    EDIT^2:

    I have downloaded your code and placed myself in netp directory. Compiled the code like this:

    C:\netp>"C:\Program Files\Java\jdk1.6.0_25\bin\javac.exe" -cp jcifs-krb5-1.3.17.jar netp.java
    

    and succesfully run it like this:

    C:\netp>"C:\Program Files\Java\jdk1.6.0_25\bin\java.exe" -cp .;jcifs-krb5-1.3.17.jar netp
    

    it outputs:

    START
    END
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using Samba jcifs API to access Windows shares from a Java program,
using this http://bl.ocks.org/950642 we can see how to add images to nodes, the question
Using Java,I have to fetch multiple sets of values from an XML file to
Reading file using java and jcifs on windows. I need to determine size of
Using the http://www.ifans.com/forums/showthread.php?t=132024 post from another question i am allowing the user to enter
Using Java, how can I extract all the links from a given web page?
I am using jcifs-1.3.17.jar library in my android application. Following piece of code works
Using import datetime in python, is it possible to take a formatted time/date string
Using following mysql query: SELECT DATE_FORMAT(time, '%Y-%m-%d') AS time,report,count(ip) AS countip FROM asn_data WHERE
Using Java, I want to extract the words between the dollarsign symbol $ .

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.