J2EE Development on MacOSX
RyanG asks: "So I'm
looking to get a new laptop and have found myself very tempted by
Apple's iBook for a
variety of reasons like cost, performance, size, etc. Now I know
Steve Jobs once touted the Mac/OSX as the (future) premier platform
for Java development but I'm curious to know what people think of it
in practice? I'm particularly interested in hearing from people who
work with JSPs and Servlets."
One month ago, I and one partner were convinced that we should build our
own web site. He will supply contents and I will program it. So, I
bought a iBook and downloaded JSDK 2.0, JWServer 2.0,
JSP 1.1. For database, at this stage is JDBC. Later plan is
to have JDBC+Oracle. I am a long time Java programmer. But I am new for
JSP and JWServer. In about 2 weeks, I learned those stuffs. And I am
very impressed by JSP concepts. Then, after I and my partner agreeed on
the business plan, I started to code (many time spend on learning JSP,
JWServer, session, cookie, etc). In about 3 weeks (each day for 5 hr), I
did set up the programming frame of our site. Now, I have about 20 jsp
files, and about 10 Bean files to support back end logic and database
connections, also have about 10 HTML files to do presentations, like
form, statements. Up to now, I am very happy I made a right decision to
use JSP tech, instead of old Perl (Do you have other tech which is
basically free and powerful? So, cold fusion and ASP is not in the range
of our touch). Anyway, our site is up now, the site is dynamic, and the
logic is not simple and can really support any logic easily since we
have a full language is behind of us.
I experienced some bad things. The bundled JRE of JWServer is JDK 1.1.7,
which has no many methods of JDK 2.0. Yet, if you use JRE of 2.0, then,
I experienced some very bad crash of Server, i.e. some perfect JSP pages
could crash the Server, and I do not know the reason at all. So, I have
to use JRE of 1.1.7 and changed my codes back to 1.1.7's API. After
this, the Server crash seems gone. I can have Server runs smoothly for
several days.
I think the speed is satisfactory for me. At beginning, I am worried
about database speed. Not any more. Of course, our site is not connected
to net yet, all testing is via a 56K modem (actual line speed is often
less than 30K). Seems our Server serves page quite fast. I can only
hope when many users visit our site, our this configuration can still
live well. My guess is that since JSP/Servlets utilize many threads, the
scalibility is not that hard. If we have powerful machine to handle
these threads (like multi processors), we have no bottle neck at
business logic side. The bottle neck will be database and traffic. We
can't do anything on traffic. For database, only hope Oracle will help
us. Maybe this is too naive. Since whole codes are written very strictly
by Sun's standard of Java (all resources are in property files, for
example), I hope it can move to different machine, Web server, database
easily. But, this is unknown also.
Up to now, I would recommend anybody to use JSP/Servlet tech for new web
developments.
If you don't like WebObjects, that's fine. Tomcat runs great on OS X (and you can find a point-n-click installer on the web), and Project Builder is a good dev environment. Besides, where else can you use photoshop, illustrator, gimp, and apache all on one box?
Care about electronic freedom? Consider donating to the EFF!
A good website (and you probably already have been there) is http://developer.apple.com/java.
Here's a good overview from Apple of Developing Java Applications on OS X
Just for another point of reference though, I use the open-source Eclipse IDE on my Windows 2000 Athlon, and I love it. I'm used to developing server side Java on Windows, though. As far as I can tell, Eclipse isn't available for OS X yet. They'd have to port the SWT widget set to OS X. However, JBuilder 6 is coming out for Mac OS X, and should have the native Aqua UI.
And last, just to stoke the flames, I think a lot of the people who use Linux would benefit greatly from taking a look at Mac OS X. Go down to CompUSA or (insert-your-retailer-here) and play with the new G4 boxes. The Aqua UI will blow your mind (XP doesn't even come close).
Tips and Tricks for Mozilla
first off, it works really well for development. you can run any of the all java IDEs like netbeans or forte from sun or even borland's jbuilder
i've been using jbuilder4 for a while. i had a bit of a hack getting the linux version to install, but once i did, its all straight up java 2 code, so it ran fine. (i prefer jbuilder4 since its got the ability to load in the vi editor tool from sourceforge - jvi.sourceforge.net i've got tomcat 3.2.1 and 4.0 running fine on my pb, and it all works like a champ.
i've found that the java integration into osX is outstanding. apple has made it one of the languages to code full on applications for osX with. i've got a coworker who does use the apple IDE projectBuilder to do his java development, so i know its possible. i just havent done it. i use jbuilder on NT at work, so i wanted to keep the same project files.
WebObjects is just slightly overated. There is little documentation, and when something goes wrong you are dependent on a fairly small community and apple for support.
JSP and Tomcat are much better solutions. They is a large support community and they are FREE! Furthermore I have read about people running JBoss for EJBs. I have not actually done this myself yet, but plan to within the next couple of weeks. MySQL runs just fine. Personally I uese vi as my editor, but there are many IDE's to choose from, including IDEA's intelliJ IDE, which is an all Java IDE that supports code refactoring.
Finally, I would like to say that when you're not programming, you will find OS X to be a great OS. Although it does not sound like a big deal, iTunes is almost reason enough to get a mac. I have never used an mp3 player that was so intuitive. Just make sure you have at least 256MB of Ram to handle the Aqua interface with some ease.
Do yourself a favor and get a lowend Titanium instead of the iBook:
- It has a better processor.
- If you plug a monitor in, you're not limited to doing mirroring of the LCD, you can make a big virtual desktop. It's really a nice setup to develop on. Documentation on one screen (javadoc rules...) and dev tools / editor on the other...
And that's before talking about the LCD size (iBook: 12 inches, G4: 15 inches)
Quentin
I know this is a little sick, but I actually prefer emacs (with JDE, which totally rocks). Has anyone used it (succesfully) on OS X?
-------------------------
A person of moderate zeal
I was impressed because almost everything that I have written that is pure java works flawlessly. The GUIs have the nice new bubbly plastic look and feel to them and life is good. This alone is enough to make we want to use OS X as my development platform.
On the other hand I was frustrated because java programs we so hard to use. Mac OS X.1 added the ability to double click on a jar file to start a java program. Until then you had to go to the command line to start java programs. For an OS that prides itself on being GUI oriented, that is just unacceptable. There is some sort of utility to put some sort of macintosh wrapper around your java files, add and icon and make them look like a mac program. It all looks nice but it means that you will have to offer a separate mac download. That would be ok sometimes, but unfortunatly the utility is only a mac GUI program. I didn't see a way to script the process and add it to my makefile. The program also doesn't run on linux and windows which is where I do most of my builds. If there were a java port of this utility which I could run from a makefile, I would be much happier.
The other frustration I had also dealt with lack of command line support. I wanted to open a web browser but was unable to find a command line to pop up IE. I finally found some class libraries to open a browser that were hidden (not in the classpath I might add) somewhere on the machine. Getting java to work with other programs is much easier on both Linux and Windows.
Other than those couple nits, I really think OS X and java have a very bright future.
Yes, it comes with the developer tools CD that ships with Mac OS X.
That's funny. Didn't the FSF boycott Apple because of their look and feel lawsuits? It always seemed that the Mac ports of emacs were renegade programs. Now Apple ships it. gotta love it.
the good ground has been paved over by suicidal maniacs
That's the beauty of the GPL, isn't it? The FSF can bitch and moan all they want about Apple, but if Apple wants to distribute or port emacs, they are 'free' to do so, as long as they comply with the terms of the license.
-------------------------
A person of moderate zeal
Assuming your message isn't a troll, you do seem to be using some software that is a quite substancially out of date in the Java world. Here's a few pointers:
- JSDK 2.0 is a reference implementation of a servlet dev kit by Sun. It's old. Sun has handed the servlet engine writing over to the guys at jakarta.apache.org , and they're putting out a servlet/JSP engine called Tomcat that's pretty damn good. Get Tomcat version 4.0.1 from
http://jakarta.apache.org/site/binindex.html
On a decent spec machine you should definitely experience more snappyness from Tomcat 4's improved engine - and it's a decent web server too. It's pure Java.
- Tomcat runs best on Java2SE version 1.3 . Assuming you have Mac OX X (your iBook is only a month old, right?) it should be preinstalled on your laptop. For other platforms get it from the java web site at java.sun.com. You really do not need to be using JDK 1.1.7, that's old. J2SE v1.3 might have a slightly bigger memory footprint but overall is definitely worth it.
-You mention that the bottle neck is at the database. You say you're using JDBC, but JDBC is just a connection protocol, what's your actual database? On windows, Sun provides some useful but non-production JDBC drivers for linking to ODBC data sources. They would definitely be a slow down factor, but if you get a decent database, the supplied JDBC drivers should make that go away. Try MySql from mysql.org, there are proper JDBC drivers available for that. Oracle is a good DB but possibly a bit too expensive!
Good luck with the site. Have fun and keep learning!
Roberto
I use netbeans and jedit under linux and windows. I find windows to be the faster of the two, but prefer a unix environment. How does OSX compare performance wise? Startup lag kills me!
anyone? - cheers.
--- there's no there there.