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 8097973
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T21:55:43+00:00 2026-06-05T21:55:43+00:00

I am trying to build a Java SNMP client. I have a folder on

  • 0

I am trying to build a Java SNMP client. I have a folder on my Ubuntu desktop called snmpclient. Inside that folder I have the main class Client.java and the snmp.jar library, which is used by the main class.

I managed to compile it sucessfully using the following command on the terminal:

~/Desktop$ javac snmpclient/Client.java -classpath ./snmpclient/snmp.jar 

Then I tried to run it with this command:

~/Desktop$ java snmpclient.Client -classpath ./snmpclient/snmp.jar

But I am getting a “java.lang.ClassNotFoundException” error, saying it can’t find the classes of the snmp library. I unzipped the jar file to make sure the classes I am using are all there, and they are.

Any idea on how I can solve this?

  • 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-05T21:55:45+00:00Added an answer on June 5, 2026 at 9:55 pm

    I would rearrange your args thus:

    ~/Desktop$ java -classpath ./snmpclient/snmp.jar snmpclient.Client
    

    such that your classpath preceeds the class to run. Note that your classpath defaults to the current directory if you don’t specify -classpath, so your full invocation should be:

    ~/Desktop$ java -classpath ./snmpclient/snmp.jar:. snmpclient.Client
    

    to specify the root directory where your classes reside (that’s the dot), plus the SNMP jar file.

    The -classpath arg consists of jar files and paths to directories separated by colons. See here for more info on setting the classpath.

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

Sidebar

Related Questions

I'm trying to get my java build to fail when I have a class
I do have a java server. I am trying to build IPhone application that
I am trying to build remote desktop application using java. For that what I
I am trying to build a Java applet, called game , which is something
I am trying to build a java ee webservice that has a common base
I have been trying to build an online java compiler. But running the clients
I'm trying to build my Flex/Java web app from within IntelliJ rather than have
I'm trying to build a new java swing component, I realise that I might
I am trying to build an MVC application in Java Swing. I have a
I am currently trying to build a Java Project with several dependencies. I have

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.