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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T12:09:05+00:00 2026-06-08T12:09:05+00:00

I am a pharmaceutical sciences student who is picking up coding as I go,

  • 0

I am a pharmaceutical sciences student who is picking up coding as I go, so I apologize if the answer to this question has escaped me.

I wrote some java source code in NetBeans AND Eclipse. The code runs fine in both IDEs, however when I moved all the .java files to a UNIX environment I was successful at compiling the code, but the command line tells me it can’t find a class that is located in the same jar that I compiled with. I got warnings on compilations but I thought this would not affect the running of the code. I have searched and searched and can’t seem to find an answer. Here is my command line code (there are names of my programs, etc.):

[jknights@u2:~]$ cd chorus_jk

[jknights@u2:~/chorus_jk]$ ls
Chorus_JK.java       EntropyNormal_JK.java   Main_JK.java
colt.jar             EstimateParzen_JK.java  RA_reformatted_forCHORUS_JK.txt
Combination_JK.java  LIST_JK.java

[jknights@u2:~/chorus_jk]$ javac -cp colt.jar ./*.java -Xlint:unchecked
.
.  (I edited out the 100 warnings as they refer to unchecked items)
.

100 warnings

[jknights@u2:~/chorus_jk]$ jar cfe ChorusJK_RA.jar Main_JK ./*.class

[jknights@u2:~/chorus_jk]$ java -jar ChorusJK_RA.jar
89
317504
Exception in thread "main" java.lang.NoClassDefFoundError: cern/colt/matrix/DoubleMatrix2D
    at Chorus_JK.init(Chorus_JK.java:24)
    at Main_JK.main(Main_JK.java:23)
Caused by: java.lang.ClassNotFoundException: cern.colt.matrix.DoubleMatrix2D
    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)
    ... 2 more

the “89” and “317504” are summary outputs for the file that is read in so it appears that the compile was successful; however, when the program gets to the calculation part, it gives me the Exception in thread “main” java.lang.NoClassDefFoundError: cern/colt/matrix/DoubleMatrix2D error. Thanks so much for any help!

  • 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-06-08T12:09:07+00:00Added an answer on June 8, 2026 at 12:09 pm

    Your difficulty in getting your code to run from the command line demonstrates the value of an IDE. If I understand your work flow correctly, you developed your code on one machine with an IDE, then you had to run it on a different computer without a GUI environment, so you were stuck with the command line. This is fairly common, especially for web application development.

    Netbeans creates a dist folder (distribution) and you can configure your project to copy your libraries to a lib folder (I think that’s the default behavior). The manifest file contained inside the jar file should contain a line like this:
    Class-Path: lib/colt.jar

    You can examine the contents of your jar file with a zip tool or within your IDE. In netbeans from the file view you can expand your dist folder and then expand the jar to examine its contents.

    Before moving your code from a graphical environment to a command line, try just running your program without the IDE. You should be able to double-click the jar file in the /dist folder and it should run. If it does, then you should be able to move the entire /dist folder to a different computer with a different operating system and it should still run without needing to add -cp colt.jar to your command line arguments.

    You should not need to re-compile your code to get it running on a different operating system. Simply move the /dist folder and you should experience the joy of “write once, run anywhere.”

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

Sidebar

Related Questions

I need to work on a Dynamics project in next 3 months with Pharmaceutical
I need to design a table for daily sales of pharmaceutical products. There are
Im doing a project of order management system and the scenario is like this
I'm trying to populate a Drop down list with pharmaceutical companies, like Bayer, Medley
I work for a small marketing company that has asked me to develop a
I am using the following JSON: http://www.kb.dk/tekst/mobil/aabningstider_en.json When I try to parse it by
Suppose I have a composite class PharmaProduct (which represents the product hierarchy of a
Ok, so i am having trouble again. the part of my ERD im having
I've been looking for a while and want a way to sort a JSON
Task : Take two text files and output 100% matches and 75% matches. Solution

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.