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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T08:15:41+00:00 2026-05-18T08:15:41+00:00

For a class exercise on game trees , I have to write code that

  • 0

For a class exercise on game trees, I have to write code that works with a .jar file. I haven’t used Java in this way before. My Eclipse project tree looks like this:

Project tree

To run the code, I was told to do this on the command line:

java -jar VierOpEenRij.jar Mens spel.speler.Random 5 5

How do I debug this code? I have tried tinkering with Eclipse’s debug configurations and I also tried executing jdb -jar VierOpEenRij.jar Mens spel.speler.Random 5 5 but I can’t figure out a way to start the debugger.

How do I debug my code when a .jar file contains the main method?

  • 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-18T08:15:42+00:00Added an answer on May 18, 2026 at 8:15 am

    I might be completely off as I haven’t really been in this situation, but wouldn’t right-click on the jar -> debug as … -> Java application do the trick?

    EDIT:

    Managed to make it work this way:

    • need a “semi” runnable jar (seems to be your case: main class in there but missing dependencies, and the manifest should indicate a main class)
    • add the main to the buidl path (in package explorer view, right click on jar -> build-path -> add to build path).
    • in the package explorer view’s build path node, expand the jar until your drill down to the main method, right click and run or debug as java application.

    For some reason I would expect to be able to right-click the jar and do directly dbug as java app though… the main is indicated in the manifest, but it doesn’t seem to find it. Don’t know why. But in the meantime, that works.

    EDIT2: Actually, now I can directly right-click the jar (or even the project) and select the right main when a dialog pops up, and it’s all good. Maybe I missed something earlier. Any way, you’re good to go.)

    In the picture below, MainInJar.main() calls ClassOutOfJar.somethingOutOfJar(), which prints something to the screen.

    Main in Jar

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

Sidebar

Related Questions

This is a learning exercise in expression trees. I have this working code: class
Hey, This is just a simple exercise from class that I decided to have
I have this code: require 'rubygems' require 'activeresource' ActiveResource::Base.logger = Logger.new(#{File.dirname(__FILE__)}/exercises.log) class Exercise <
I have the following exercise: Define a class named circle that accepts objects of
I got this exercise at uni: Write a program that declares a shared integer
I have a File class that has an Open() method. I have a subclass
As a programming exercise, I've written a Ruby snippet that creates a class, instantiates
As a small exercise I am trying to write a very small, simple game
This exercise is taken from Google's Python Class : D. Given a list of
Its a exercise that ask to indicate the class Big-Theta(g(n)) the functions belongs to

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.