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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T00:16:33+00:00 2026-05-24T00:16:33+00:00

I’ve just come back to fix some bugs in a small program that I’ve

  • 0

I’ve just come back to fix some bugs in a small program that I’ve written, and now I can’t compile because a package doesn’t exist (according to javac).

As far as I know, I haven’t changed anything in my class path, or the contents of my directories. I don’t know if there have been any Java updates in between.

In my root directory, I have the four Java files that comprise my program. They don’t have any package ascribed to them. Additionally, I have the directory structure org\apache\commons\cli in the root directory which contains the CLI java files from the Apache Commons. The Apache files do have a package ascribed that mirrors the directory structure in which they lie.

If I issue the command javac -verbose -d build CommandLine.java, it fails with

CommandLine.java:28: package org.apache.commons.cli does not exist
import org.apache.commons.cli.*;
^

CommandLine.java is the entry point of the program.

There is no attempt by the compiler to compile the CLI files, and if I compile them beforehand, the failure still takes place. Also, the CLI is also available in my classpath.

I am running javac 1.6.0_12.

What can I do/try?

.

EDITED FOR ANSWER:

As accepted below, I altered the compilation command to be:

javac -verbose -d build -classpath . CommandLine.java

Now it works. Don’t know why it did before, and why it stopped now though…

.

EDITED FOR CAUSE OF PROBLEM

I installed a program that also used the CLASSPATH to run its own things. It changed the CLASSPATH that belonged to the user, but left the global one alone. I re-added the java classpath things back in and it works again!

  • 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-24T00:16:34+00:00Added an answer on May 24, 2026 at 12:16 am

    Did you unpack that Apache JAR and add the .class files to your application? Why didn’t you just add the JAR to your CLASSPATH?

    You should not be depending on a CLASSPATH environment variable. Better to use the -classpath option for javac.exe when you compile and java.exe when you run.

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

Sidebar

Related Questions

I have just tried to save a simple *.rtf file with some websites and
I have a jquery bug and I've been looking for hours now, I can't
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
For some reason, after submitting a string like this Jack’s Spindle from a text
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I used javascript for loading a picture on my website depending on which small
I've got a string that has curly quotes in it. I'd like to replace
this is what i have right now Drawing an RSS feed into the php,
I have a French site that I want to parse, but am running into

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.