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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T13:41:28+00:00 2026-05-28T13:41:28+00:00

My program compiled fine. But the problems start when I try to run it.

  • 0

My program compiled fine. But the problems start when I try to run it.

jesvin@Jesvin-Technovia:~/dev/drools/sudoku$ java App 
Exception in thread "main" java.lang.NoClassDefFoundError: org/drools/planner/core/solution/Solution
Caused by: java.lang.ClassNotFoundException: org.drools.planner.core.solution.Solution
        at java.net.URLClassLoader$1.run(URLClassLoader.java:217)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:321)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
Could not find the main class: App. Program will exit.

I know that the interface Solution was correctly resolved in compile time.

Here is the offending class Sudoku that implements Solution:

package domain;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.List;

import org.drools.planner.api.domain.solution.PlanningEntityCollectionProperty;
import org.drools.planner.core.solution.Solution;
import org.drools.planner.core.score.SimpleScore;

public class Sudoku implements Solution<SimpleScore>{
...

And here is the App class that is supposed to use an instance of the Sudoku class

import java.util.ArrayList;
...

import org.drools.planner.config.XmlSolverConfigurer;
...

//solution too
import org.drools.planner.core.solution.Solution;

import solution.SudokuGenerator;
import domain.Sudoku;

public class App{
    public static void main(String[] args){
    SudokuGenerator sg = new SudokuGenerator();
    Solution sudoku = sg.createSudoku();
    Solver solver = createSolver();
    solver.setPlanningProblem(sudoku);
    solver.solve();

    Sudoku result = (Sudoku) solver.getBestSolution();
    result.displaySolution();
    }

    private static Solver createSolver(){
    XmlSolverConfigurer configurer = new XmlSolverConfigurer();
        configurer.configure("solver.xml");
        return configurer.buildSolver();
    }
}

Is it the result of me wrongly casting between Sudoku and Solution?


My classpath is set as:

declare -x CLASSPATH=".:/home/jesvin/dev/drools/sudoku/binaries"
  • 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-28T13:41:28+00:00Added an answer on May 28, 2026 at 1:41 pm

    As @GPRathour wrote above, you need to add the jars from drools planner to the classpath.

    I guess /home/jesvin/dev/drools/sudoku/binaries is a directory. You need put jars there.
    Some thing like…

    declare -x CLASSPATH=".:/home/jesvin/dev/drools/sudoku/binaries/drools-planner-core.jar

    A better approach will be to add jars in the command line via -classpath

    java -classpath path/jar1;path/jar App

    In a exception stack you should always check the ’caused by ‘ messages. In this your real exception was Caused by: java.lang.ClassNotFoundException: org.drools.planner.core.solution.Solution.

    ( Other thing to note– Use packages. Having classes in appropriate packages helps lot in reading code later.)

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

Sidebar

Related Questions

My C(++) program, written and compiled using Visual C(++)/Visual Studio, runs fine on my
Is there any way, from within a Java program compiled by gcj, to find
HI, I would like to run a cygwin compiled program in visual studio using
I compiled a Java program as javac t1.java > a in order to redirect
This program compiles fine but seg faults when running the value->getSmall in Period::display() .
I have a ASP.NET program that works just fine but takes 10 seconds to
The example program below compiles two in-memory assemblies. The first compilation works fine. The
I'm new to Mono and just started recently. Is mono program are compiled from
I've compiled my Python program using Py2Exe, and on the client's computer we've satisfied
I was trying to compile a program using an external compiled object coreset.o. I

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.