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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T10:39:53+00:00 2026-05-23T10:39:53+00:00

I was having the same problem as mentioned here: exception-in-thread-main-java-lang-noclassdeffounderror-wrong-name I had no problems

  • 0

I was having the same problem as mentioned here: exception-in-thread-main-java-lang-noclassdeffounderror-wrong-name

I had no problems executing with eclipse but with terminal I got a NoClassDef. Rising one folder and executing java <package-name>.<class-name> worked perfectly.

My simple code is the following:

package temp;

import org.fusesource.jansi.Ansi;

public class Test {

    public static void main(String[] args) {

        System.out.println("I'm going to blow on the next line!");
        System.out.println( Ansi.ansi().eraseScreen().render("@|bold,red Hello|@ @|green World|@") );

    }

}

I know this code runs, because I copied it from the Jansi’s author page. It’s a library to print in color on a windows’ terminal. What do I need to do to run this class? Help is much appreciated.


[UDPATE: SOLUTION]

I was advised to create a jar of the application I was trying to test and then run that jar. So I created the jar “jprinter” containing all my files (not the external jar I was using) and the test class with the main. After that I could execute in any folder

java -cp ".\lib\jprinter-1.15.jar;.\lib\*" print.test.Test

where lib is the folder with my and other jars used; print.test is the package of the class Test which contains the main method.


[outdated:]
I tried executing by running java .:..\lib\jansi-1.4.jar temp.Test which gave me the following ouput:

I'm going to blow on the next line!
Exception in thread "main" java.lang.NoClassDefFoundError: org/fusesource/jansi/Ansi
        at temp.Test.main(Test.java:13)

And I also tried executing by running java ".:..\lib\jansi-1.4.jar" temp.Test or java ".;..\lib\jansi-1.4.jar" temp.Test which gave me the following ouput:

Exception in thread "main" java.lang.NoClassDefFoundError: \lib\jansi-1.4\jar
Caused by: java.lang.ClassNotFoundException: .:..\lib\jansi-1.4.jar
        at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
  • 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-23T10:39:54+00:00Added an answer on May 23, 2026 at 10:39 am

    [UDPATE: SOLUTION]

    I was advised to create a jar of the application I was trying to test and then run that jar. So I created the jar “jprinter” containing all my files (not the external jar I was using) and the test class with the main. After that I could execute in any folder

    java -cp ".\lib\jprinter-1.15.jar;.\lib\*" print.test.Test
    

    where lib is the folder with my and other jars used; print.test is the package of the class Test which contains the main method.

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

Sidebar

Related Questions

I'm having the same problem as described here , unfortunately the solution does not
I am having the same problem as this post but the answer does not
I am having virtually the same problem as this: C# Update combobox bound to
Edit 1: Uninstalled & Reinstalled Edit 2: Same problem. Seriously? Yes. I am having
I'm having this problem, same as ever, but never try to find the right
I'm having problems to iterate twice on the same array: <? $indice=0 ?> <?php
I felt like I'm having the same issues as addressed here . But everything
I have two third-party libraries occasionally having the same symbol name exported. When the
I have read this question and I am having the same problem: Put text
i am having the same problem described in the following post Android emulator reports

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.