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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T23:34:47+00:00 2026-06-14T23:34:47+00:00

So I want to run a class called WordFrequencyCounter which is nested in the

  • 0

So I want to run a class called WordFrequencyCounter which is nested in the folder: C:\Users\Mike\Documents\Computer Science\AI\Machine Learning\175\Assignment 2\src\ir\assignments\two\b

but when I go into that folder and run:

javac WordFrequencyCounter.java

it gives me an error because it says that it cannot find
import ir.assignments.two.a.Frequency;
specifically it says package ir.assignments.two.a does not exist, but this file is located in:

C:\Users\Mike\Documents\Computer Science\AI\Machine Learning\175\Assignment 2\src\ir\assignments\two\a

I also tried calling javac WordFrequencyCounter.java from within the folder: C:\Users\Mike\Documents\Computer Science\AI\Machine Learning\175\Assignment 2

but that does not work either. So what I want is to be able to compile and run WordFrequencyCounter and then feed it an input file that is located in
C:\Users\Mike\Documents\Computer Science\AI\Machine Learning\175\Assignment 2 from the command line. I can do this from the IDE but can’t get it to work through command line.

I think this is a classpath related problem but I couldn’t find anything useful on this for my particular example, and nothing I tried worked.
enter image description here

Here’s the main method for WordFrequencyCounter:

public static void main(String[] args) throws FileNotFoundException {
    File file = new File(args[0]);

    List<String> words = Utilities.tokenizeFile(file);

    List<Frequency> frequencies = computeWordFrequencies(words);
    Utilities.printFrequencies(frequencies);
}
  • 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-14T23:34:50+00:00Added an answer on June 14, 2026 at 11:34 pm

    go to src folder and run

    javac -d . ir/assignments/2/b/MainClass.java

    and use java ir.assignments.2.b.MainClass to run it.

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

Sidebar

Related Questions

I want to automatically run a class method defined in a base class on
I want to run the constructor of the Main.class in the package Test2, located
I want to use NUnit to run my class library. So, I click the
Hi : I want to run an operation immediately after Guice hydrates my class
I want to write a simple class (PHP5) that can 'run' an unknown amount
Consider, there is a class called SuperClass from which, ClassA , ClassB , ClassC
I have a class called Menu and inside that class I want to place
I have a property called CustomerForOwner on a class called Owner. I want a
I have an UI, a custom class, and a thread. I want to run
I have a class called Menu.java which is used as the interface for my

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.