# Project Builder Java Problem (NoClassDefFoundError)



## treybomb (Jan 20, 2002)

Things were working just fine until for whatever reason I decided to click
"Clean".  Since then, every time I've tried to build and run my program, I
get the following runtime error:

java.lang.NoClassDefFoundError: myProject
Exception in thread "main"
java has exited with status 1.

(http://developer.apple.com/techpubs/macosx/Java/Reference/Java/java/lang/NoClassDefFoundError.html)

The program compiles just fine, and I know the code is fine because the
program was working great before I clicked "Clean" and I haven't changed the
code at all since then.  I've tried creating a new project and adding the
.java files to it, and I still get the same runtime error.  Same error if I
try running the program from the commandline using _java_...  Any ideas?

- Treybomb

OS X 10.1.2
December 2001 Dev Tools


----------



## Ghoser777 (Jan 20, 2002)

A breif description of what your code does please?  Could u post the source for us to examine?  The best way to debug errors is to use a lot of System.out.println("insertHandySaying"); inbetween specific lines of code where you think the problem is, run the code, and notice what the last print outs are to isolate where the problem is coming from.

HTH,
F-bacher


----------



## treybomb (Jan 21, 2002)

I'm pretty sure the code works fine.  Like I said, the program was working great before I clicked "Clean."  It's an assignment for a class that reads a number of "DNA strands" (cgattaggc...) from a file and searches them for overlaps and merges the strands together in the proper sequence.  Actually there's a "correct sequence" posted on the class website, and my program generated the same sequence, so I know it works properly.  Anyway, I downloaded Borland JBuilder 6 Personal today and put my 5 .java files in there, and it worked great.  Compiled fine, ran fine, and outputted the correct fully-sequenced DNA strand perfectly.  

So then you're gonna say: "Well why not just use JBuilder then..."  Well, I'm not so impressed by the interface and design...   Sure, it works great, but Project Builder is definitely a step above.  I really think Project Builder's a great app, and if possible, I'd like to get it working again so I can continue my work without having to learn a new IDE.  

I'll post the code tomorrow if I get a chance.  But I'm pretty sure that's not the issue.  At first I thought I may have mucked up the JDK installation somehow, but I can't imagine how I could've done that without being logged in as root.  Also, I tried reinstalling the Dec2001DevTools without any success.

Another interesting sidenote.  Java isn't _completely_ broken; the default HelloWorld template compiles and runs fine.  But on the other hand I guess that doesn't involve multiple classes.  

Any ideas would be most appreciated.  The deadline for this assignment is rapidly approaching.  =)

- TreyBomb


----------



## kermit64 (Jan 22, 2002)

My project builder still works, but i get that error when trying to write a program that will run from the command line.  I would just write a simple program like

public class a
{
public static void main(String a[])
{  System.out.println("Hello World!");  }
}

then type in the console

javac a.java
java a.class

then it spits that error at me.  i don't know what's going on but if this helps you, or you can tell me what i'm doing wrong, that would be cool.  also i had to write the same assignment for school at UT for Scott's class.  is yours for the same one?


----------



## tie (Jan 22, 2002)

javac a.java; java a

Another problem might be the classpath.  Set the $CLASSPATH variable, or look in "man java" to set it via the command-line.  

To set the classpath in ProjectBuilder, go to build options.  Then under one of the tabs, there is an "Advanced" button which will show you the classpath option.  This is a very frequent problem.


----------



## treybomb (Feb 4, 2002)

Still havin the same problem.  Bump.


----------

