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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T13:25:35+00:00 2026-05-12T13:25:35+00:00

I looked at some other SO questions, didn’t find anything that solved my problem…

  • 0

I looked at some other SO questions, didn’t find anything that solved my problem… I have a Main.java file (below) and a OthelloLib.jar file without associated source files.

Running javac Main.java fails with

Main.java:8: cannot find symbol
symbol  : class SimplePlayer
location: class Main
        OthelloPlayer p1 = new SimplePlayer();

and a few more errors. SimplePlayer and BetterPlayer are defined in the jar. How do I tell java about this jar? This command: javac -classpath .:OthelloLib.jar -g Main.java doesn’t cause an error, but I still don’t know how to run the program. If I run java -classpath .:OthelloLib.jar Main, java complains:

Exception in thread "main" java.lang.NoClassDefFoundError: TimeoutException

but TimeoutException.java is in the same directory as Main.java.

I don’t know where to look up basic Java stuff like this, so here I am!

public class Main {
  public Main() { }
  public static void main(String[] args) {
    OthelloPlayer p1 = new SimplePlayer();
    OthelloPlayer p2 = new BetterPlayer();
    OthelloObserver o = new OthelloSimObserver();

    // Create an untimed game
    OthelloGame g = new OthelloGame(p1, p2, o);
    System.out.println("Starting game");
    g.run();
  }
}
  • 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-12T13:25:35+00:00Added an answer on May 12, 2026 at 1:25 pm

    You run

    javac -classpath .:OthelloLib.jar Main.java
    

    to compile, then

    java -classpath .:OthelloLib.jar Main
    

    In each case the -classpath .:OthelloLib.jar option tells Java where to find SimplePlayer and other classes you need; it doesn’t know to look in the JAR file on its own. And you do need to tell both the compiler and the virtual machine where to look for the classes.

    EDIT: Looks like you added something about TimeoutException since I wrote this… did you remember to compile TimeoutException.java? And is the TimeoutException.class file in the same directory as Main.class?

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

Sidebar

Related Questions

I have looked at the other questions related to this problem but I do
I have used tutorials, examples and looked at numerous other questions about my problem
I looked at some other questions on SO and its not clear if c
(Ive looked at the other questions - none seemed to quite fit my problem.)
I looked at other questions regarding this problem and tried their solutions, but it
I looked to some similar questions but I didn't really get my answer, so
Ok I'm stuck, I've looked at some other questions on here but no help,
I've looked at many questions that are similar to mine but I didn't see
Having looked at some of the other mysql availability query questions on here has
I looked around and found other questions that had answers but none of them

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.