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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T16:58:02+00:00 2026-06-08T16:58:02+00:00

So I made a project with packages in Eclipse. I have a few classes

  • 0

So I made a project with packages in Eclipse.
I have a few classes all in same package com.example.parser.
In Eclipse everything works fine.
So I wanted to run one of the class from command line.
The java/javac PATHs are set correctly and work normally if no packages are there.
The file structure looks like this:

~Project/bin/com/example/parser/*.class (all class files)
~Project/src/com/example/parser/*.java (all source files)

So in command line I go to ~Project/bin/com/example/parser
To mention OS: Windows 7 Pro
The command java ClassToRun gives

Exception in thread "main" java.lang.NoClassDefFoundError: ClassToRun (wrong name:
com/example/parser/ClassToRun) at ... (stack trace)

So I googled a bit and got to conclusion this is the correct command:
java -cp .;~Project/bin ClassToRun
Now I get this:

Error: Could not find or load main class ~Project/bin

So I could not solve this… any one can help a bit?
PS: Forgot to mention the “/” should be “\” and the “~” stands for the abs path infront.
Oh yeah and I just update to jdk 1.7…

  • 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-08T16:58:03+00:00Added an answer on June 8, 2026 at 4:58 pm

    Did you type the fully-qualified class name at the command prompt?

    i.e.

    java -cp .;~Project\bin name.of.package.Class
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have used org.reflections (http://code.google.com/p/reflections/) in my project for loading classes with certain annotations.
I have a project made with PhoneGap 1.1. I don't want to upgrade to
I have made a project in which i have added a splash screen by
I'm using SAS Enterprise Guide 5.1 and I have a project made of 4
I made an android project using eclipse. It looks like: src/ ActivityMain.java lib/ Square.java
I have made a java project and want to deliver it to a client
here I uploaded my Android project made in Eclipse. The idea is that i
i have made an android application for Project Build Target as Target name:: Android
I am currently struggling with Maven: I have a complex project made of several
I have an android application created and built in eclipse, it's made of 2

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.