Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > help for Java/Project Builder newbie

help for Java/Project Builder newbie
Thread Tools
Fresh-Faced Recruit
Join Date: Nov 2000
Location: Canada
Status: Offline
Reply With Quote
Jan 22, 2003, 12:25 AM
 
Am at uni and trying to use Mac OS X to do all my java assignments. Unfortunately I am having problems moving back and forth between the IDE we use in the labs and Project Builder. In the labs I can compile and run my apps fine (throughing no run time exceptions). When I try and run them at home, they compile fine but I through an exception everytime. The error message generated is:
"Exception in thread "main" java.lang.NoClassDefFoundError: Ass1

java has exited with status 1."

For this assignment the prof supplied some classes specific to handling input/output. I'm thinking the problem likely lies in how I am setting the class path in Project Builder. But what confuses me is that if the class path is set incorrectly the file shouldn't be compiling in the first place. Any help would be greatly appreciated! Thanks.
     
Mac Elite
Join Date: Dec 2001
Location: Atlanta, GA, USA
Status: Offline
Reply With Quote
Jan 25, 2003, 10:47 PM
 
classpath for javac and for java can be different. Remember that if the classes are in a package their location has to reflect the namespace.

For some interesting experiments on this, read here:

http://www.harford.cc.md.us/faculty/...classpath.html
Mac Pro 2x 2.66 GHz Dual core, Apple TV 160GB, two Windows XP PCs
     
Mac Elite
Join Date: Oct 2001
Location: Internet
Status: Offline
Reply With Quote
Jan 26, 2003, 11:00 AM
 
Originally posted by hoffa8:
Am at uni and trying to use Mac OS X to do all my java assignments. Unfortunately I am having problems moving back and forth between the IDE we use in the labs and Project Builder. In the labs I can compile and run my apps fine (throughing no run time exceptions). When I try and run them at home, they compile fine but I through an exception everytime. The error message generated is:
"Exception in thread "main" java.lang.NoClassDefFoundError: Ass1

java has exited with status 1."

For this assignment the prof supplied some classes specific to handling input/output. I'm thinking the problem likely lies in how I am setting the class path in Project Builder. But what confuses me is that if the class path is set incorrectly the file shouldn't be compiling in the first place. Any help would be greatly appreciated! Thanks.
I use PB to do my java homework as well and I used to get these messages too. You have to make sure that your PB file is the same name as your java file that contains <main>.

try this aned let us know what happens...

By the way, where are you studying?

MacBook Air 11" 1.6Ghz 4GB 128GB Backlit Keyboard, 4S, iPad 2
     
hoffa8  (op)
Fresh-Faced Recruit
Join Date: Nov 2000
Location: Canada
Status: Offline
Reply With Quote
Feb 2, 2003, 08:26 PM
 
Thanks for all your help. The link provided by Arkam_c was very useful!

P.S. I attend Queen's University in Kingston.
(Last edited by hoffa8; Feb 2, 2003 at 08:57 PM. )
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 02:05 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2