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 > Adding new Java Classes to PB

Adding new Java Classes to PB
Thread Tools
macrophyllum
Mac Enthusiast
Join Date: Sep 2000
Location: Vermont, USA
Status: Offline
Reply With Quote
Dec 11, 2001, 03:37 AM
 
I am a novice programmer and I want to use the javamail classes in my Cocoa Java application. I have downloaded the javamail package from Sun's web site, but I don't know how to make it so that I can actually use its classes in Project Builder. The file I downloaded has a bunch .jar files. Do I need to install those files somewhere and then just add a line of code to my app to import them? Anyone got any suggestions?
     
Kristoff
Mac Elite
Join Date: Sep 2000
Location: in front of the keyboard
Status: Offline
Reply With Quote
Dec 11, 2001, 03:49 AM
 
I'm not too familiar with PB, I use Forte for Java from Sun Microsystems which is, IMHO, the best Java IDE because it is platform agnostic.

But, you should read the docs at Apple's developer site on where to put external classes. I think system wide ones go in /Library/Java/Home/ext

Then, they should be in your classpath. But, since I don't know how PB handles them, I don't know if you have to add them to the project somehow.

In Forte, you just mount the jar in you project and all is good.

Forte is a highly evolved IDE and has such a rich feature set that I really recommend you try it out.
signatures are a waste of bandwidth
especially ones with political tripe in them.
     
absmiths
Mac Elite
Join Date: Sep 2000
Location: Edmond, OK USA
Status: Offline
Reply With Quote
Dec 11, 2001, 11:51 AM
 
Originally posted by Kristoff:
<STRONG>I'm not too familiar with PB, I use Forte for Java from Sun Microsystems which is, IMHO, the best Java IDE because it is platform agnostic.</STRONG>
Forte is nice, and I always use it on Windows, but the Mac OS X version is just too painful when you need it 8 hours a day. Add jar files to PB by selecting Project-&gt;Add Framework then select the jar file and it will pop onto the left side of the project.

I had to resort to installing ant and creating make files for my project so I could open and edit the files in PB and BBEdit, and keep a shell open for compiling. It is actually more productive than Forte as I seem to spend extra time in Forte repeating missed mouse clicks and waiting for windows to appear and disappear just because I change views.

Be warned though that last I checked PB compiles EVERY Java file with each compile - not just the new ones. That gets REAL annoying real fast.
     
macrophyllum  (op)
Mac Enthusiast
Join Date: Sep 2000
Location: Vermont, USA
Status: Offline
Reply With Quote
Dec 11, 2001, 12:31 PM
 
I like using Project Builder because it it makes it really easy to build Cocoa apps with Interface Builder.

After I import it into PB by "Add Framework..." do the classes just become available to me?

Do you know where I would put the .jar files so that I can look at them using JavaBrowser?
     
absmiths
Mac Elite
Join Date: Sep 2000
Location: Edmond, OK USA
Status: Offline
Reply With Quote
Dec 11, 2001, 12:53 PM
 
Originally posted by macrophyllum:
<STRONG>I like using Project Builder because it it makes it really easy to build Cocoa apps with Interface Builder.
</STRONG>
I am really excited about this - I am experimenting with Java Cocoa now - I think Apple is on the right track there. I hope they provide more low-level system hooks like native drawing and system commands, etc, to enable more functional apps without native code (sort of like JDirect works in MRJ on Mac OS 9 and Classic)

<STRONG>After I import it into PB by "Add Framework..." do the classes just become available to me?

Do you know where I would put the .jar files so that I can look at them using JavaBrowser?</STRONG>
Yes - the compiler and the interpreter (within PB) will both find the classes. I don't know about the java browser - I imagine it uses the system classpath which means the extensions directory. I never use that because I have too many different projects going on which all have specific requirements with versions, etc, and I would prefer to manage the classpath explicitly. Maybe if you set the CLASSPATH variable at a prompt, then invoked it from the CL?
     
Kristoff
Mac Elite
Join Date: Sep 2000
Location: in front of the keyboard
Status: Offline
Reply With Quote
Dec 12, 2001, 01:50 AM
 
Originally posted by absmiths:
<STRONG>

Forte is nice, and I always use it on Windows, but the Mac OS X version is just too painful when you need it 8 hours a day. </STRONG>



What do you mean? It is cross platform. It's all the same. I use the same version on Windows, Linux, Solaris, and Mac OSX. I have been using it on OS X for well over 8 hours a day--work + graduate research in the evening. I don't have any problems. Did you set it up like they said at Netbeans.org?

Maybe I can help you get it running right. I use it on my DP 800 with 1.2 GB of RAM and it is very fast. It runs well on my Pismo 500 with 640 MB too. RAM is the key. You must have at least 512 to run Forte with other things running at the same time (tomcat, jBoss, etc).
signatures are a waste of bandwidth
especially ones with political tripe in them.
     
absmiths
Mac Elite
Join Date: Sep 2000
Location: Edmond, OK USA
Status: Offline
Reply With Quote
Dec 12, 2001, 06:56 PM
 
Originally posted by Kristoff:
<STRONG>
What do you mean? It is cross platform. It's all the same. I use the same version on Windows, Linux, Solaris, and Mac OSX. I have been using it on OS X for well over 8 hours a day--work + graduate research in the evening. I don't have any problems. Did you set it up like they said at Netbeans.org?
</STRONG>
The problem is it's too slow, and the UI is freaky. E.G., 1 - When you change views (edit/debug/running, etc) windows maximize and minimize, 2 - double-clicking on items in the explorer sometimes works, sometimes doesn't, 3 - The UI flashes alot because of buffering issues and it redraws needlessly.

Forte is useable (mostly) on my TiG4 (with the exception of the UI things mentioned before - those bugs indeed exist on every platform), but on my G3/300 it is an excercise in futility. As I mentioned before, on Windows it is great, on Linux it is great (because there is no reasonable alternative), on Mac OS X, it is too counter-productive (so is CW, BTW).
     
absmiths
Mac Elite
Join Date: Sep 2000
Location: Edmond, OK USA
Status: Offline
Reply With Quote
Dec 12, 2001, 06:59 PM
 
Originally posted by Kristoff:
<STRONG>
What do you mean? It is cross platform. It's all the same.</STRONG>
The program is, but the VM and OS are not. That makes all the difference.
     
Kristoff
Mac Elite
Join Date: Sep 2000
Location: in front of the keyboard
Status: Offline
Reply With Quote
Dec 13, 2001, 01:52 AM
 
I know what you mean now.

The double click thing is a bug in the JVM--I reported that at 4K60!

Netbeans 3.3 was released today (the Forte code base) and it is much faster, and many UI enhancements as well. Try it out and let me know if it's any better for you. Like I said, on my machines it works fine, but I can imagine how sluggish it must be on a G3 300
signatures are a waste of bandwidth
especially ones with political tripe in them.
     
absmiths
Mac Elite
Join Date: Sep 2000
Location: Edmond, OK USA
Status: Offline
Reply With Quote
Dec 13, 2001, 05:38 PM
 
Originally posted by Kristoff:
<STRONG>I know what you mean now.

...
Netbeans 3.3 was released today (the Forte code base) and it is much faster, and many UI enhancements as well.</STRONG>
Do you know if they will start using the system look and feel instead of hard-coding the metal look and feel? One of the early versions did that (Forte, I think. I don't think NetBeans ever did) and it was supposed to work better.
     
Kristoff
Mac Elite
Join Date: Sep 2000
Location: in front of the keyboard
Status: Offline
Reply With Quote
Dec 13, 2001, 07:42 PM
 
You have always been able to use the Mac look and feel.

./runide.sh -jdkhome /Library/Java/Home -ui com.apple.mrj.swing.MacLookAndFeel -fontsize 10

That's what I use.
signatures are a waste of bandwidth
especially ones with political tripe in them.
     
absmiths
Mac Elite
Join Date: Sep 2000
Location: Edmond, OK USA
Status: Offline
Reply With Quote
Dec 14, 2001, 04:16 PM
 
Originally posted by Kristoff:
<STRONG>You have always been able to use the Mac look and feel.

./runide.sh -jdkhome /Library/Java/Home -ui com.apple.mrj.swing.MacLookAndFeel -fontsize 10

That's what I use.</STRONG>
OK, well this is one of those issues where I think developers need a slap on the wrist. I have written several Swing apps (commercial ones, too), and I always make it a point to include a way for the user to select the L&F - either from a cheesy "Look An Feel" menu, or at least in the preferences. I would never instruct my users to append CL arguments for things that have always been the domain of the application preferences.
     
Kristoff
Mac Elite
Join Date: Sep 2000
Location: in front of the keyboard
Status: Offline
Reply With Quote
Dec 15, 2001, 01:19 PM
 
Interesting take....I kinda agree and I kinda don't.

But, I certainly don't fault the NetBeans developers and heres why:
Until now, there has been no UI that is worth the trouble.
What I mean is, the metal L&F is better than Windows, and CDE.
Swing stuff is incredible srewed up in KDE (last I checked), and I don't think the GTK themes with Sawfish and whatnot allow that kind of integration with Swing apps. So basically, nobody would go through the trouble to make NetBeans use the MS Windows L&F over the Metal L&F.
Finally, along comes aqua, which is way cool, and we now finally have a UI that is much better than Metal, so we want to use it.
If you want to add that to the prefs in NetBeans, that would be cool! It is open source
signatures are a waste of bandwidth
especially ones with political tripe in them.
     
   
 
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
Top
Privacy Policy
All times are GMT -4. The time now is 02:38 AM.
All contents of these forums © 1995-2017 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.8 © 2000-2017, Jelsoft Enterprises Ltd.,