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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T12:13:41+00:00 2026-05-25T12:13:41+00:00

I am compiling helloworldapp with no errors. I am running java helloworldapp on windows

  • 0

I am compiling helloworldapp with no errors.

I am running
java helloworldapp
on windows

CLASSPATH:
.;C:\Program Files\Java\jre7\lib;

JAVA_HOME:
C:\Program Files\Java\jre7

path includes
C:\Program Files\Java\jdk1.7.0\bin\

Result:

C:\Users\k\Desktop\abcl-bin-0.26.2>java helloworldapp
Exception in thread "main" java.lang.NoClassDefFoundError: helloworldapp (wrong
name: HelloWorldApp)
        at java.lang.ClassLoader.defineClass1(Native Method)
        at java.lang.ClassLoader.defineClass(Unknown Source)
        at java.security.SecureClassLoader.defineClass(Unknown Source)
............etc

So ok, for some reson it couldn’t find the classes, so I am trying to do it manually.

C:\Users\k\Desktop\abcl-bin-0.26.2>java -cp "C:\Program Files\Java\jre7\lib" helloworldapp
Error: Could not find or load main class helloworldapp

C:\Users\k\Desktop\abcl-bin-0.26.2>java -cp C:\Program Files\Java\jre7\lib; helloworldapp
Error: Could not find or load main class Files\Java\jre7\lib;

What am I doing wrong?
I have looked at several forums, but they weren’t particularly helpful.

Update, I got past the helloworld stage.
Now the real problem

import org.armedbear.lisp.*;

public class Main
{

    public static void main(String[] argv)
    {
    try
        {
        Main thisObject = new Main();
        Interpreter interpreter = Interpreter.createInstance();
        interpreter.eval("(load \"lispfunctions.lisp\")");
        org.armedbear.lisp.Package defaultPackage = 
            Packages.findPackage("CL-USER");
        Symbol voidsym = 
            defaultPackage.findAccessibleSymbol("VOID-FUNCTION");
        Function voidFunction = (Function) voidsym.getSymbolFunction();
        voidFunction.execute(new JavaObject(thisObject));
        }
    catch (Throwable t)
        {
        System.out.println("exception!");
        t.printStackTrace();
        }
    }
    public int addTwoNumbers(int a, int b)
    {
    return a + b;
    }
}

I tried both

C:\Users\k\Desktop\abcl-bin-0.26.2>java -cp abcl.jar Main
Error: Could not find or load main class Main

C:\Users\k\Desktop\abcl-bin-0.26.2>java -cp abcl.jar main
Error: Could not find or load main class main

The abcl.jar is located in the same folder

Some more trials and errors

C:\Users\k\Desktop\abcl-bin-0.26.2>java -cp .:abcl.jar Main
Error: Could not find or load main class Main

C:\Users\k\Desktop\abcl-bin-0.26.2>java Main -cp .:abcl.jar
Exception in thread "main" java.lang.NoClassDefFoundError: org/armedbear/lisp/Li
spObject
        at java.lang.Class.getDeclaredMethods0(Native Method)
        at java.lang.Class.privateGetDeclaredMethods(Unknown Source)
        at java.lang.Class.getMethod0(Unknown Source)
        at java.lang.Class.getMethod(Unknown Source)
        at sun.launcher.LauncherHelper.getMainMethod(Unknown Source)
        at sun.launcher.LauncherHelper.checkAndLoadMain(Unknown Source)
Caused by: java.lang.ClassNotFoundException: org.armedbear.lisp.LispObject
        at java.net.URLClassLoader$1.run(Unknown Source)
        at java.net.URLClassLoader$1.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        ... 6 more
  • 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-25T12:13:42+00:00Added an answer on May 25, 2026 at 12:13 pm

    When you write a class in java, the name of the file must match the name of the class.

    class HelloWorldApp {
        public static void main(String[] args) {
            System.out.println("Hello world");
        }
    
    }
    

    must be saved as HelloWorldApp.java
    It must match the case i.e. helloworldapp.java would not work.

    When you need to run the class, you must refer to it using the correct case.

    java HelloWorldApp
    

    but not

    java helloworldapp
    

    If you are referencing a JAR then you need to add it to your classpath. By default the classpath consists of the files in the current working directory.
    On windows the classpath is a semi-colon (;) separated list, on Linux and Mac OSX it is a colon (:) separated list.

    To include the JAR in the classpath you must run the following…

    java -cp .:myjar.jar MyMainClass
    

    where myjar.jar is the JAR file you want to reference and MyMainClass is the class that contains your public static void main method.

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

Sidebar

Related Questions

Upon compiling and running this small program to reverse a string, I get a
When compiling latex documents the compiler emits a lot of object files. This clutters
Compiling (or executing) a perl program with unmatched array braces ([ ]) or scope
Compiling my project against STLPort I get some weird build errors. Weird, because the
When compiling a program containing this particular function, /* * Function read_integer * *
Compiling a program to bytecode instead of native code enables a certain level of
Whilst compiling with avr-gcc I have encountered linker errors such as the following: undefined
When compiling the following C code with ndk-build in Terminal (I'm running Ubuntu): #include
While compiling a Visual Studio 2010 program, I included the python2.5 directory. In the
OK, I just cannot get java to run my .class files: I follow steps

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.