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 > Classpath / which Dir for classes

Classpath / which Dir for classes
Thread Tools
Fresh-Faced Recruit
Join Date: Aug 2001
Location: Germany
Status: Offline
Reply With Quote
Jan 15, 2002, 04:11 AM
 
I develop an app with PB.
Now I always get an error while running the app that a

java.lang.ClassNotFoundException: myClass

How could I edit the Classpath or where should I place the myClass.java ?
I tried it in the dir of the application, but this doesn't work.

Mark
     
Fresh-Faced Recruit
Join Date: Jan 2001
Status: Offline
Reply With Quote
Jan 15, 2002, 09:08 AM
 
Originally posted by Mark Goebl:
<STRONG>I develop an app with PB.
Now I always get an error while running the app that a

java.lang.ClassNotFoundException: myClass

How could I edit the Classpath or where should I place the myClass.java ?
I tried it in the dir of the application, but this doesn't work.

Mark</STRONG>
If you're developing it in PB, then you should let it handle the location of the files if you're not sure where they go.

If this is a new project, you might just try starting a new one and pasting in what code you have. If this works, look around and take note of the file locations.
     
Mac Elite
Join Date: Sep 2000
Location: Edmond, OK USA
Status: Offline
Reply With Quote
Jan 15, 2002, 09:12 AM
 
PB is really simplistic in it's handling of files. I keep my source files in a package heirarchy under the project root just like I would in any other project, and I add them to project builder the same way - so that the package heirarchy is represented in the folder list. Of course, package declarations must jive with the directory structure and you're there. My guess is that one of a couple of things happened:

1 - You removed myClass.java from the project
2 - You renamed myClass.java to something else.
3 - You changed the package declaration within myClass.java

The solution to all of these is the same. Locate your main class, then go into the Target-&gt;Executable-&gt;Argument settings and change the class name from myClass to whatever it needs to be.
     
Mac Elite
Join Date: Sep 2000
Location: in front of the keyboard
Status: Offline
Reply With Quote
Jan 16, 2002, 11:34 PM
 
I have to really say, that developing java apps in PB sucks.
I am a NetBeans/Forte biggot, but I decided to give PB a fair shake.
Kids, it's like comparing a casio watch calculator to an HP 48 GX.
It's like a go-ped to a harley...
like a hang-glider to a harrier...
like a ...well, you get the point.
signatures are a waste of bandwidth
especially ones with political tripe in them.
     
Mac Elite
Join Date: Sep 2000
Location: Edmond, OK USA
Status: Offline
Reply With Quote
Jan 17, 2002, 08:57 AM
 
Originally posted by Kristoff:
<STRONG>It's like a go-ped to a harley...
like a hang-glider to a harrier...
like a ...well, you get the point.</STRONG>
I wouldn't go quite that far - Forte has its' advantages and disadvantages and so does PB. One of those happens to be that if you want to write Java cocoa apps PB is the only option. I have personally resorted to using Ant for builds and BBEdit for editing. Once I discovered 'open' from the command line everything fell into place...

[ 01-17-2002: Message edited by: absmiths ]
     
Mac Elite
Join Date: Sep 2000
Location: in front of the keyboard
Status: Offline
Reply With Quote
Jan 17, 2002, 04:29 PM
 
Do You know Netbeans/Forte has ANT support?
signatures are a waste of bandwidth
especially ones with political tripe in them.
     
Mac Elite
Join Date: Sep 2000
Location: in front of the keyboard
Status: Offline
Reply With Quote
Jan 17, 2002, 04:32 PM
 
Originally posted by absmiths:
<STRONG>
I have personally resorted to using Ant for builds and BBEdit for editing. Once I discovered 'open' from the command line everything fell into place...
</STRONG>
Why don't you use JADE?
signatures are a waste of bandwidth
especially ones with political tripe in them.
     
tie
Professional Poster
Join Date: Feb 2001
Status: Offline
Reply With Quote
Jan 17, 2002, 04:36 PM
 
Originally posted by Mark Goebl:
<STRONG>How could I edit the Classpath or where should I place the myClass.java ?</STRONG>
I don't have PB in front of me, but to edit the classpath, you go to the build options target and the classpath variable is in one of the tabs. It's one of the "Advanced" options, so it's a little hard to find.
The 4 o'clock train will be a bus.
It will depart at 20 minutes to 5.
     
   
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 09:43 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