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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T15:12:28+00:00 2026-05-29T15:12:28+00:00

I have project which includes external jar file in it, I followed this link

  • 0

I have project which includes external jar file in it, I followed this link http://www.wikihow.com/Add-JARs-to-Project-Build-Paths-in-Eclipse-%28Java%29 to add external java path. Then I tried to compile my code in terminal, however I am still get an error about jar file does not exist.

I wrote the following commands: (Currently I am in the project directory and there are three folders called bin src and lib in there)

bash-3.2$ ls
bin  lib  README.txt  src
bash-3.2$ javac -cp lib/jsoup-1.6.1.jar src/DayTradingStockBlog.java
bash-3.2$ java -cp .:lib/jsoup-1.6.1.jar src/DayTradingStockBlog
Exception in thread "main" java.lang.NoClassDefFoundError: src/DayTradingStockBlog (wrong name: DayTradingStockBlog)
        at java.lang.ClassLoader.defineClass1(Native Method)
        at java.lang.ClassLoader.defineClassCond(ClassLoader.java:632)
        at java.lang.ClassLoader.defineClass(ClassLoader.java:616)
        at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
        at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
        at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
Could not find the main class: src/DayTradingStockBlog.  Program will exit.

How should I solve this problem ?

  • 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-05-29T15:12:28+00:00Added an answer on May 29, 2026 at 3:12 pm

    You never use slashes, which are path delimiters, in a call to java (but to javac). If src is part of your package declaration – in this case the whole package declaration, which I bet it is not, you would, instead of:

     java -cp .:lib/jsoup-1.6.1.jar src/DayTradingStockBlog
    

    use a dot:

     java -cp .:lib/jsoup-1.6.1.jar src.DayTradingStockBlog
    

    But I guess it is just the place where you created the class, so the path belongs to the classpath:

     java -cp .:lib/jsoup-1.6.1.jar:./src DayTradingStockBlog
    

    You aren’t free to omit the path from the Class name, and append it to the classpath, or vice versa – it has to fit to your package declaration.

    If you declare a package foo, (which has much more sense than src), your class name is no longer DayTradingStockBlog but foo.DayTradingStockBlog.

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

Sidebar

Related Questions

I have C++ project (VS2005) which includes header file with version number in #define
Hi I have a visual studio project which includes postbuildevents in the following form:
I have a external jar file named xxx.jar. I use xxx.jar in my GWT
I have c++ project on Visual Studio 2010. I have a file A.h which
I have a ASP.NET project which relies upon the FreeImage .NET wrapper. This is
I have a project in vc++ which using standerd windows library and source file
I currently have a project which includes a ton of externals which needs to
I have a project which has a calling structure similar to this: main project/application
I've written a multi-project .vstemplate file, which works alright, except that the projects have
I tried to create a jar file from a java project, which uses some

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.