J2EE Development on MacOSX 24
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."
My Experience (Score:1, Interesting)
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.
Here's some advice on pursuing JSP (Score:1)
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
WebObjects (Score:3, Informative)
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?
Re:WebObjects (Score:2)
Err, Windows. Provided you can get around the brain-damaged memory-management that Photoshop and Illustrator inherited from their mac cousins ("allocate 50% of memory to this app"?).
Re:WebObjects (Score:2)
Server Side Java Development with OS X (Score:5, Informative)
A good website (and you probably already have been there) is http://developer.apple.com/java [apple.com].
Here's a good overview from Apple of Developing Java Applications on OS X [apple.com]
Just for another point of reference though, I use the open-source Eclipse IDE [eclipse.org] 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).
osX for java development? you betcha. (Score:3, Interesting)
first off, it works really well for development. you can run any of the all java IDEs like netbeans [netbeans.org] or forte from sun [sun.com] or even borland's jbuilder [borland.com]
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 [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.
get a Titanium instead of the iBook (Score:1)
- 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
Re:get a Titanium instead of the iBook (Score:1)
You can have your internal LCD screen and another one (connected via the standard VGA plug on the Titanium) making one big virtual desktop.
Once you've worked on a dual screen setup, you feel really bad looking at a single screen...
;-)
Take note that this is not possible with the iBook.
emacs (Score:1)
Re:emacs, yes (Score:1)
Re:emacs, yes (Score:1)
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.
Re:emacs, yes (Score:1)
Re:emacs (Score:1)
I'm a former vi convert. I still use vi for quick and dirty stuff, but emacs (XEmacs) is fantastic for my Java, C++, and Perl coding.
Re:emacs (Score:1)
* Get fink (http://fink.sourceforge.net/)
* Use fink (or apt-get, which fink installs) to get the rootless XFree86 and the real emacs
* Get the OroborOSX window manager (http://julia.et.ic.ac.uk/adrian/software/oroboro
* setenv EDITOR
* tweak your
(set-default-font "-adobe-courier-medium-r-normal--12-120-75-75-m-7
(setq mac-command-key-is-meta t)
* Do your happy geek dance.
--realinvalidname
When OS X first came out (Score:3, Insightful)
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.
Re:When OS X first came out (Score:2)
Batch/Shell script - sucky on any platform, especially bad on Mac OS.
Double clickable jars - better on any platform, but most end users won't know how to use them, so a file like "How do I launch this fscking app?" would probably need to be in the distro.
As for MRJAppbuilder - its the only option (other than CodeWarrior or the ProjectBuilder IDE) that will give you that polished application. You might investigate if CodeWarrior on Linux or Windows can make Mac Java apps, but I'd guess not, and it obviously costs money.
As for MRJ app builder, its written in Java, but it might well need native code. You could certainly write the xml files required, but it uses a small binary launcher stub.
Then again, since you obviously care about user experience you should really be producing a little
You might be able to build a generic launcher that will launch any java application which follows some naming convention you define (eg, make your jar be called appClasser.jar and your main class be com.myclasses.Main). Certainly this was possible on Mac OS 9 - then you wouldn't need to regenerate the launcher every time you release.
File a bug with Apple requesting a cross platform solution (developer.apple.com). You need to join up, but its free.
As for opening IE - if all you do on Windows is
Runtime.exec("iexplore.exe");
then you've just annoyed me, because you've ignored my browser preferences.
What you want is Eric Albert's BrowserLauncher... works out the user's prefered browser and works pretty much everywhere you're likely to want to be, and is free:
http://browserlauncher.sourceforge.net/
Re:When OS X first came out (Score:2)
Executable jar files are the generic solution you were looking for to launch java apps. You should just be able to double-click on them. The only thing they lack is an icon. I would have to say that Windows options for launching java programs aren't much better than macintosh, however there are several command line installer builders that I can invoke when I need to use custom windows code.
what is performance like under OSX (Score:1)
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.