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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T18:07:10+00:00 2026-05-28T18:07:10+00:00

I arranged my class to reverse URL notation (newb’s reaction to a finicky package).

  • 0

I arranged my class to reverse URL notation (newb’s reaction to a finicky package). I have the sudoku directory in my home. It hold the binary packages for ‘Drools Planner’ in binaries and my sources. The directory is arranged like

jesvin@Jesvin-Technovia:~/dev/drools/sudoku$ ls src/main/java/in/co/technovia/sudoku/
App.class  App.java~  helloworld.class  helloworld.java~
App.java   domain     helloworld.java   solution

My classpath points to . and the above-mentioned binaries of ‘Drools Planner’.

jesvin@Jesvin-Technovia:~/dev/drools/sudoku$ export | grep CLASSPATH
declare -x CLASSPATH=".:/home/jesvin/dev/drools/sudoku/binaries/*"

The App.java has this in first line: package in.co.technovia.sudoku;

I tried to run the App class in the root of my source using the fully qualified package name:

jesvin@Jesvin-Technovia:~/dev/drools/sudoku$ java in.co.technovia.sudoku.helloworld
Exception in thread "main" java.lang.NoClassDefFoundError: in/co/technovia/sudoku/helloworld
Caused by: java.lang.ClassNotFoundException: in.co.technovia.sudoku.helloworld
    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: in.co.technovia.sudoku.helloworld. Program will exit.

My question is kinda elementary to Java: how do I run the java command or set the CLASS_PATH so that the package runs fine?

  • 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-28T18:07:11+00:00Added an answer on May 28, 2026 at 6:07 pm

    The class file resides in the same folder as your java file (in your case), so you need to use

    CLASSPATH=".:/home/jesvin/dev/drools/sudoku/src/main/java"
    

    Then, to execute the class, use the command you posted in the question, it should work.

    When your code is correctly compiled to the binaries directory, you could add this directory to the classpath (not use ‘*’ in the end, because this adds all sub directories instead!). Then, check that there is a directory named in inside, as the directory structure must reflect the package structure.

    Further, I want to kindly ask you to follow the Java Naming Conventions and always start class names with a capital letter! Java Naming Conventions

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

Sidebar

Related Questions

I have a class that gets arranged into a hierarchy, such as this: class
I have a class that gets arranged into a hierarchy, such as this: class
I have a canvas with user controls arranged on it. When a tooltip is
Say I have 3 frames in a frameset arranged in 3 rows. Frames 1
We have a page that ordinarily has two elements arranged side-by-side. Despite exploring a
Say I have a list and I want it arranged so that the sum
I have a simple model: class User < ActiveRecord::Base has_and_belongs_to_many :roles end class Role
I have some vectors of class A objects: std::vector<A> *V1; std::vector<A> *V2; etc there
I have a grid view which is populated using a custom ImageAdapter class extending
I have a web page with 16 textboxes arranged in a 4x4 grid. The

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.