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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T18:14:10+00:00 2026-05-27T18:14:10+00:00

Requirements: Command-line only, i.e. no IDE’s Do not want to use classpath argument OS:

  • 0

Requirements:

  • Command-line only, i.e. no IDE’s
  • Do not want to use classpath argument
  • OS: OS X v10.6.8

Steps:

  • Setup CLASSPATH environment variable: export CLASSPATH="/path-jar-files-are-at/*"
  • Compile my java app: javac MyApp.java
  • Launch my java app: java MyApp

After launching, the following error appears:

Exception in thread "main" java.lang.NoClassDefFoundError: MyApp
Caused by: java.lang.ClassNotFoundException: MyApp

Using classpath argument doesn’t have this problem

  • Compile my java app: javac -classpath /path-jar-files-are-at/* MyApp.java
  • Launch my java app: java -classpath /path-jar-files-are-at/* MyApp

Any ideas?

  • 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-27T18:14:11+00:00Added an answer on May 27, 2026 at 6:14 pm

    The CLASSPATH should not contain the trailing “/*” – that is not going to give you a valid classpath. The shell is expanding the /* and separating the list with whitespace/newlines – rather than the “:” character.

    If you still really want it to work this (dynamic) way, try something like this:

    export CP=`ls /path-jar-files-are-at/*`; CP=`echo $CP | sed 's/\.jar\s/.jar:/g'`; CP="$CP:/path-jar-files-are-at"
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to install the PowerShell Community Extensions using only the command-line. I don't
I'm learning how to use the command line by requirement for a recent project.
Requirements: Must be able to use C strings as well as C++ strings Fast
My requirements: Support .NET Compact Framework 2.0 and Windows Mobile 6.0 devices. Only need
I have a command line php app that I need to distribute to a
I'm toying with the idea of writing a command line interpreter and I suspect
I have an executable that depending on the command line switch supplied looks something
I need a one line command for the below requirement. Search all the files
Is there an existing PHP, Javascript, or even command line tool that can build
I'm using Boost Program Options Library to parse the command line arguments. 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.