# Programming in Java on Mac



## anerki (Jan 16, 2005)

A couple of questions, a simple one if you program in Java yourself:

I use XCode to write all my code and compile it, but I find it dreadfully slow. Takes ages to load and even takes ages just to type the code (every letter is delayed for some reason). I program on a 1Ghz G4 with a Gb of RAM so that should be enough, no? What application do you use to write in Java?

Also, is there an application like TogetherSoft for Mac OS X? TogetherSoft generates code for buttons, ActionListeners and the likes with a drag and drop and click interface. It also allows you to make UML schemes and put your classes/methods directly in it for easier writing.

Thanks in advance!
Frederik-Jan


----------



## Viro (Jan 16, 2005)

I don't use Xcode. I find it a little too unintuitive for my tastes and I come from a UNIX background. Personally, I find using a text editor and makefiles very productive as you spend more time programming and solving problems, instead of spending time fighting with the IDE.

As for Java, I like Netbeans. I've found it to be the best Java IDE. A close second goes to Eclipse. Both of these have a GUI builder so you might want to check those out. Can't say how they compare to TogetherSoft as I've never used that before.


----------



## anerki (Jan 16, 2005)

Awesome, I'll check those out this weekend after this week's exams. Got Java exam tuesday


----------



## wyvern (Jan 16, 2005)

I prefer to use just a text editor to edit my java. jEdit is my editor of choice.


----------



## Arden (Jan 16, 2005)

Are you programming cross-platform applications or Mac applications?  If you're programming Mac applications, you can use Java within the Cocoa environment, which allows you to use Interface Builder for dragging buttons and the like.

As for text editing, do you have any other editors on your computer?  There are a number I could recommend that you might enjoy, which you could tell Xcode to use for editing.


----------



## wyvern (Jan 16, 2005)

If you're programming strictly for the Mac, you might as well use the Obj-C cocoa bindings instead of the Java ones. They're more complete and less buggy. Obj-C is a nice language, too.


----------



## anerki (Jan 16, 2005)

Obj-C? It has to be Java, for both Mac and PC. It has to compile and run Applets and normal Java thingies (can't find the name right now). That's all I require basically. Oh, and support Methods/Classes that are in different java files.


----------



## gumse (Jan 17, 2005)

I use BBEdit for editing Java.
Ant for building and deploying Java.
Abeille Forms Designer for GUI design.


----------



## HateEternal (Jan 17, 2005)

I prefer eclipse - it is very customizable and can be as simple or as complicated as you want it to be. It runs really good on my G5 and OK on my iBook G4 800. I really like the way it works with CVS. I didn't use it with a team project but rather to keep my projects synced up between my desktop and my laptop.

I tried using netbeans for a while, I didn't like it and went to eclipse. They are quite similar but eclipse just seemed to fit better with me.

I would recommend learning how to use something like netbeans or eclipse now even if your programs are simple. If you plan to continue on with programming and build some more complicated programs you will be glad that you learned how to use a powerful IDE rather than a text editor.

You could also try Dr Java for starters I hear it is a simple IDE to learn on, never tried it my self though.


----------



## anerki (Jan 17, 2005)

Thanks for all the input everybody, keep them coming! I'll try some of them out over the weekend and the others after my finals. I'll post a small review of the applications after I tried some of them out!


----------



## wiz (Jan 29, 2005)

personally i prefer eclipse over netbeans.. but when it comes to gui programming, netbeans rules over elcipse. eclipse VE (visual editor) is horrible and buggy (crashes the IDE at times). aside from this only downfall (for eclipse), it really is one of the best ide i've ever used.


----------



## chadwick (Feb 1, 2005)

Eclipse is very good, and is usually the IDE I suggest for people who want a free one. I use IntelliJ IDEA from http://www.jetbrains.com/ for my Java development. 

I still find the G4 Macs too slow for most Java stuff. My 1GHz iBook was just too slow for any of the Java editors to be useful, IMO. The 1.42GHz Mac mini I have now is usable, but still snail-like compared to my PCs when running Java. The Java 1.4.2 Update 2 Apple released not too long ago REALLY helped, but not enough.


----------



## rdennison (Feb 2, 2005)

are any of you software developers?  wow, EVERYONE i know in the field who do java say emacs > *.  i tend to agree.....


----------



## Viro (Feb 3, 2005)

Yes, I'm a developer in the sense that I program for a living. Emacs is horrible. It doesn't support loads of the features found on current IDEs, like code folding, refactoring, documentation lookup, GUI building, etc.


----------



## Mephisto (Feb 3, 2005)

Except GUI building Emacs does support all the above features.  I prefer to use Eclipse though, which also does not have GUI building (at least not by default).

I go back to Emacs when I need to do C/C++.  For Java I find Eclipse better.  For Objective-C XCode.  NetBeans and JDeveloper are also nice, but I feel more comfortable in Eclipse.  Just go with what you find comfortable.


----------



## cfleck (Feb 3, 2005)

how do you get code folding in emacs?


----------



## lurk (Feb 3, 2005)

What flavor do you want, emacs probably invented folding.  Here is a pointer to get you started.

http://www.emacswiki.org/cgi-bin/wiki/CategoryOutline


----------



## wiz (Feb 3, 2005)

the problem with IDE's for the java platform.. they are all so amazing.. they outbeat any "IDE" avaliable for other languages and other platforms (ehm wait...) 

anyhow.. yea JDeveloper is also a really cool IDE.. u should check it out.. All have their advantages and disadvantages. IntelliJ is ok, has a cool interface etc.. but so do most other IDE's now-a-days. As far as featues are concerned. They are all just as feature rich as each other.. 

Wow, that screwed u up didin't it, now you really dont know what to use


----------



## loves_the_IIsi (Feb 10, 2005)

I used to use NetBeans (pre 4.0) but since the last Java class I took used Eclipse, I've switched to that. Once you get the hang of using the feature, they can be really useful, and allow you to do less typing and refactoring is a breeze. Some people have said it can make you "stupid" since it can fix errors etc. and do things automatically that otherwise you should have known. I suppose this is true, but still worth it I think.


----------



## lnoelstorr (Feb 14, 2005)

I think JBuilder is my favourite so far on the Mac, but that's probably in part due to the fact I've used it for years on Windows and Solaris.

I've tried NetBeans but it just crashes all the time on me, and hasn't been tweaked at all for the mac; however, it supports JSPs, which the free version of JBuilder doesn't.

I gave up with Java and XCode - it was causing far too many headaches.


----------



## xuratoth (Mar 4, 2005)

Should XCode come with the iMac? When I inserted the second disk, all that appeared to be on it, applications-wise, was OS9/Classic. If not, where can I download it? Finally, (and apologies for hijacking a Java thread), does it support HTML, SQL and PHP natively or at least with plug-ins? Here I am mainly thinking of syntax-highlighting. PHP function-insight would be a bonus but not essential.


----------



## lnoelstorr (Mar 4, 2005)

On the iMac , I think if you go to Applications -> Utilities I think there's a folder called "install developer tools", or something like that.

I think you can also get a free account on the apple developer site and download them for free from there.


----------



## Viro (Mar 4, 2005)

Better just download them from Apple. That way, you'll get the latest version.


----------



## xuratoth (Mar 7, 2005)

Thanks for the info.


----------



## chornbe (Mar 7, 2005)

anerki said:
			
		

> A couple of questions, a simple one if you program in Java yourself:
> 
> I use XCode to write all my code and compile it, but I find it dreadfully slow. Takes ages to load and even takes ages just to type the code (every letter is delayed for some reason). I program on a 1Ghz G4 with a Gb of RAM so that should be enough, no? What application do you use to write in Java?
> 
> ...




XCode is great for what it is... a free text editor with some fancy addons that some developers might want. But it's not the end-all, be-all of coding environments. 

The best dev IDEs come from Microsoft (yeah, you heard right) and Borland.

Having said that, I use NetBeans for all my java coding. It's available on the 3 major platforms (Win, Linux and Mac), is consistently built across all of them and works just fine. Borland's JBuilder is probably a little better, but the major price tag per seat is a bit intimidating for me to buy on my own.

$.02


----------



## marqrdt (Mar 8, 2005)

A very plausible defense for overweight IDEs vs. text editor/makefile Java development can be found in the vast number of features that an IDE offers for a new and even advanced Java programmer. Rather than doing it the hard way, taking three times as long and then bragging about it, as some do (no, not all), I prefer to Get The Job Done. Examples of nice IDE features include:
--offering popup lists of methods and properties.
--offering to point out studip spelling errosr in methods, variables, etc. With my typing, this alone saves several hours per  project
--offering to help constructing class definitions and method calls as well as adding methods stubs when implementing an Interface.
--pointing out stupid errors, which programmers of all stripes are prone to.

  I use the word 'offering' above, because almost all of these features can be disabled if not desired. Automatic package management is nice, too. For me, a good IDE allows me to focus on improving my design and code, not managing it.

I hope this helps--

Paul


----------



## chornbe (Mar 8, 2005)

Bingo. Well stated.


----------



## Viro (Mar 13, 2005)

After spending some time with C once again, and realizing that the API is just so much easier than Java or C# or C++, I'm beginning to think that IDEs are there to mask deficiencies in the design of APIs and languages.

Look at how complex file I/O is in Java. What does that add over the standard C I/O model apart from inefficiency and complexity? You need an IDE when your API is complex. A simple API that takes few arguments means you'll be productive even in a simple text editor. The threading model of C (pthreads or even fork(), but that's processes) isn't significantly more difficult than Java's. I've been forced to use C recently and I'm remembering why I liked programming in the first place. It's back to basics, where the language is simpler, and the code is just more elegant.

NOTE: This isn't to say that C is perfect. It just has a much simpler API and I/O is one example where it completely and utterly trumps Java. There are pointers to deal with, but good programming practices (stuff you should learn before writing C code anyway) deals with most of the issues. If you can't handle pointers, you probably shouldn't be writing code anyway.


----------



## Oscar Castillo (Mar 13, 2005)

Have you taken a look at Sun Java Studio Creator?  I think it'll be more to your liking than Xcode.  I like Xcode, but I've been using it for some time now.  I think I'm just accustomed to it and it doesn't get in the way.  It can be a bit awkward at first for new and experienced alike.


----------



## texanpenguin (Mar 15, 2005)

OK, one question above all others:

I'm doing JAVA for the first time this session and, thus far, am HATING the IDEs. I'm very comfortable in Xcode for the simple stuff (I use it for C++ command-line stuff) so ideally I'd like to work in IT again (not doing anything too complex at all; actually it's procedural command-line now), yet I can't for the life of me figure out how to add runtime arguments to the build and run command in Xcode - which is an essential requirement for me for this current assignment.

Eclipse does have it, which is why I'm using it, but all the Windows icons are burning my eyes out.


----------



## chornbe (Mar 15, 2005)

Viro said:
			
		

> After spending some time with C once again, and realizing that the API is just so much easier than Java or C# or C++, I'm beginning to think that IDEs are there to mask deficiencies in the design of APIs and languages.
> 
> Look at how complex file I/O is in Java. What does that add over the standard C I/O model apart from inefficiency and complexity? You need an IDE when your API is complex. A simple API that takes few arguments means you'll be productive even in a simple text editor. The threading model of C (pthreads or even fork(), but that's processes) isn't significantly more difficult than Java's. I've been forced to use C recently and I'm remembering why I liked programming in the first place. It's back to basics, where the language is simpler, and the code is just more elegant.
> 
> NOTE: This isn't to say that C is perfect. It just has a much simpler API and I/O is one example where it completely and utterly trumps Java. There are pointers to deal with, but good programming practices (stuff you should learn before writing C code anyway) deals with most of the issues. If you can't handle pointers, you probably shouldn't be writing code anyway.



I think what most people value about Java and many other languages is the *apparent* abstracting "away from the guts". It feels less "api-ish" to open a file stream reader object, than to deal with a pointer to a file descriptor or a file io handle. Matter of preference, if you ask me.

Another thing... probably the biggest to many people... is the fact that getting a GUI application running in something higher level like Java or C# tends to be a little easier. You don't often have to deal with message loops, low-level window construction, etc., etc.

For me, it's the fact that, unless I'm dealing with JNI-layered native stuff... which I generally try to stay away from... I *never* have to deal with *any* platform specifics. It's just not an issue. True, that sticking within the ANSI-C language and libraries, that becomes true for C as well, but you almost always need to hit the native APIs - especially when GUI apps are what's being discussed.

Again, I think it's desire and choice more than anything. I like Java. I like C# more and can't wait until Mono fully matures. But let's be very clear.. I don't love C# because it's a MS-born thing. I like it because C# and the .NET CLR spec comprise a "better java than java". Again, it's not innovative; it's evolutionary.

And good.

$.02


----------



## Viro (Mar 15, 2005)

chornbe said:
			
		

> I think what most people value about Java and many other languages is the *apparent* abstracting "away from the guts". It feels less "api-ish" to open a file stream reader object, than to deal with a pointer to a file descriptor or a file io handle. Matter of preference, if you ask me.
> 
> Another thing... probably the biggest to many people... is the fact that getting a GUI application running in something higher level like Java or C# tends to be a little easier. You don't often have to deal with message loops, low-level window construction, etc., etc.
> 
> ...



A well designed GUI API will shield you from the intricacies of a message loop. At least, that's what it should do. Qt and GTK to a large extent do this. You deal with signals and slots, similar to listeners in Swing. The only time I actually remember working with message loops was back when I coded Win32, a good 4 years ago now.

C can be truly portable, more so than Java or even C#. Take a look at all those GTK apps. Gaim/Gimp/Abiword is available on Windows with a bit of porting. Mono is nice because it's currently running on more platforms than 'sanctioned' Java (i.e. Java blessed by Sun). Try getting Java to run on platforms unsanctioned by Sun, and you'll find it a major chore. Look at the state of Java on PPC Linux. It's a mess, with no support for Applets or Webstart. The only VM available comes from IBM. Mono is much better in this respect, since it runs on pretty much anything and if you come across a new platform that isn't supported, you could always start a port .

Simple languages like C are nice. Once people get used to the low level concepts, that is. The only thing to watch out for is dangling pointers, but then a liberal dose of assert() everywhere will help make this a non-issue .

Anyway, it's nice going off topic with you , chornbe. We always end up having good discussions, which is nice .


----------



## chornbe (Mar 15, 2005)

Agreed, thanks 

It's nice to find discussion with someone like-thinking with different P.O.Vs now and then.

Oh, and smart, too. That helps


----------

