| By Pat Shepherd | Article Rating: |
|
| July 13, 2004 12:00 AM EDT | Reads: |
19,858 |
You may not be aware of it yet, but Mac OS X - version 10.3, better known as Panther - is a great Java development environment.
I am a fairly recent Mac convert from the Windows and sometimes Unix/Linux world that I lived in. Maybe you are like me. Maybe aliens have abducted your friends and have turned them into Mac converts as well. Maybe you should join us. Speaking for myself, being able to use the Unix-based Mac OS X for WebLogic/J2EE development has given me yet another reason to be both a Java and a Mac Evangineer.
So what makes Mac OS X such a great Java development environment? Let's start with the best user interface on the planet. Add to that the core power of Unix and the ability to develop in an environment that more closely simulates the likely deployment environment for many enterprise applications (i.e., Unix-based Solaris, HPUX, and Linux). Top it all off with the use of BEA WebLogic Server and WebLogic Workshop for a surprising package of ease of use, power, and productivity.
This article is not a tutorial on WebLogic Server/WebLogic Workshop, or on Mac OS X, but it is an overview of where these technologies meet to create something that is unparalleled in the industry - a J2EE development environment on a Unix desktop done right. I will, however, provide you with basic instructions on how to set up your Mac on a productive WebLogic and WebLogic Workshop development environment. I used these instructions myself to set up WebLogic Server and Workshop successfully on my own Power Mac G5 and have used this environment to quickly and successfully create a small Web application. This application captures information, sends the information through a Page Flow (as a FormBean), writes that information to disk by using a Workshop FileControl, and finally exposes this functionality as a Web service. To do this, I created my own Workshop Domain using the Domain Configuration Wizard. All of this worked just fine, although there were some bumps along the way. I will share some of these with you.
It is important to note that at this time the Mac OS X and the Mac JVM are not official BEA-supported platforms. You must use this information within that context. So, it is up to the developer community to take it to the next level - take WebLogic Server and Workshop for a spin, report any bugs, make suggestions, and get involved.
Mac OS X Development Benefits
I wasn't going to spend much time justifying the Mac as a development platform, but I realized that a number of people may not have followed the astonishing progress of the Mac lately. You probably relate to the Mac as the "right brain" in the computing world, the creative side used by graphic artists and other nontechnical kin.The release of Mac OS X offers the power of Unix as the foundational OS substrate with, arguably, the best GUI on the planet. The only other desktop OS to effectively combine Unix and GUI is Linux. We all love Linux, but from an ease-of-use and overall desktop capabilities standpoint, it can't hold a candle to the Mac's eadership in interface technology and implementation.
But don't just take my word for it; even the Father of Java, James Gosling, has fully embraced the Mac platform (see www.apple.com/pro/science/gosling/). According to the article, James and most of his development team love developing on a Mac because it blends the power of UNIX with the best MMI (man-machine interface) or user experience available. That is to say, it provides the power of a Unix server with the ease of operation that a Windows system aspires to.
An article in the March 2004 issue of Java Developer's Journal (Vol. 9, issue 3) talks through some additional benefits of Java on Mac OS X (www.sys-con.com/story/?storyid=43949&DE=1 ).
Here are some detailed reasons why Mac OS X is a great WebLogic/WebLogic Workshop development environment.
- Java delivered as part of core system (i.e., JDK included): Java is well integrated into the OS, not an afterthought.
- GUI: Unequaled ease of-use and history of excellence that other "alternative" desktops don't have.
- Unix core: Utilities and productivity tools all at your fingertips.
- Keep your valuable UnIX skills up while improving your productivity with WLW's 10 x productivity gains: You can issue all your favorite commands right from the Terminal window (available in the Applications/Utilities folder).
- Solid UNIX distribution: Distribution of Unix on Mac OS X is BSD (Berkeley Software Distribution) that has been in existence since the '60s. - Integrates into Office Environment: Plays well with productivity tools like MS Office Suite for Mac (used in writing this article) so you will not be isolated from your team when it comes to sharing standard documents.
- Simple networking: Hook your Mac up to your home network, allowing you to do cross-platform validation and clustering in the comfort of your home.
The installation process really is as easy as 1-2-3.
- Download the correct distribution
- Run the installer
- Fix the Mac JVM distribution
Installation
The following instructions assume that you are using Mac OS X 10.3 and have JDK level 1.4.2 installed. You can check this by (a) running "java -version", which should show you that the version is 1.4.2_03 (as of this writing); or (b) by navigating to /System/Library/Frameworks/JavaVM.framework/Versions, from which you should see folders for 1.2/1.3/1.3.1/1.4.2. If 1.4.2 is not the version you see as the most recent folder, make sure to upgrade before continuing.Step 1: Download the Installation
This part is easy, as long as you have a high-speed connection. The first thing to know is which distribution of WebLogic Server 8.1 SP2 to get from BEA's download site (Click Here !). Your first choice is (a) WebLogic Platform Net Installer, (b) WebLogic Server Package Installer, or (c) Mail CD. I used option "b"and selected the IBM AIX (5.1,5.2) option, which will allow you to download a JAR file called pj_server812_generic.jar. Save this file to any folder that you use to store installation files. This file is 221.4 MB.
The file you download is the "generic" distribution that ends in ".jar" and is labeled as the AIX version on the download site. Note that this WebLogic Server/Workshop distribution, unlike, for example, the Windows distribution, does not include a JDK. We will use the JDK distribution that comes with Mac OS X 10.3 (Panther). More discussion on using the native JDK is in the "Fix the Mac Java Distribution"section.
Step 2: Run the GUI Installer
Now for installing the software. I will discuss using the GUI install wizard, though there is the option to install from the command line and even to do a silent installation. I will not bore you with the details, but you follow the directions listed in the installation guide at edocs.bea.com/wls/docs81/install/instprg.html#1054300.
Essentially, you run the following command and you are off and running/installing. The wizard walks you through the handful of steps to finish the installation.
java -jar pj_server811_generic.jar
Step 3: Fix the Mac Java Distribution
A word on the base install of your Mac JDK: the integration between the JDK and the OS is tighter than it is on other platforms. In fact Mac OS X has a layer of indirection that makes upgrading to new JDKs easy for the average user, but can be a little confusing at first glance to developers who need to know where, for example, the JAVA_HOME is.
If you try to run WebLogic Server or Workshop before you do this "fix," your servers will not start up because some directories are missing that Server and Workshop look for and, when missing, they will cause Server and Workshop to assume that you are not pointing to a valid JDK install. Further background information on the Mac JVM layout can be gleamed from an outstanding book, Mac OS X for Java Geeks by Will Iverson (O'Reilly; 2003).
Issue the following commands to allow WebLogic Server/Workshop to see your JDK as valid:
- sudo su: This is the substitute-user command allowing a permitted user to execute a command as the superuser or another user, as specified in the sudoers file.
- mkdir -p /Library/Java/Home/jre/bin: Create the missing bin directory.
- mkdir /Library/Java/Home/jre/lib: Create the missing lib directory.
- cd /Library/Java/Home/jre/bin
- ln -s ../../bin/java: Create a symbolic directory link to existing Java executables directory. A link is useful for maintaining multiple copies of a file in many places at once without using up storage for the "copies'"; instead, a link "points" to the original copy.
- cd ../lib
- ln -s ../../../Classes/classes.jar rt.jar: Create symbolic file links to existing Java library files.
Refining the Installation
After you open a terminal shell and you start the WebLogic Workshop IDE (or ISE as Gartner would call it), and attempt to run an application, Workshop tries to use Internet Explorer as the default browser. It is worth noting that you can theoretically set the browser to be anything you want. I was able to get Safari to partially work, meaning that it will auto-launch as the test harness from WebLogic Workshop when you hit the Run option. I was not, however, able to get the Mac version of Internet Explorer to auto-launch. The good news is that Netscape 7.1 for Mac OS X ran beautifully!An issue that I ran into is that the HTML and Applet that is part of the WebLogic Server console completely and utterly refuses to load in the Safari browser. So, whereas I was using Safari for the Workshop browser, for administration in the WebLogic Server console, you must use another browser such as IE.
To specify the browser that Workshop will use, you need to set the IDE properties by going to the Tools>IDE Properties menu.
Initially, I selected "/Applications/Safari.app/Contents/MacOS/Safari" to indicate Safari as the browser. It is interesting that the "Browse" button on this screen will let you navigate to the correct directory but this directory is not visible to Mac's Finder (analogous to Window Explorer) unless you CTRL-CLICK or right click the Safari icon and select "Show Package Contents" from the context menu and drill in from there.
I was able to get Safari auto-launched from Workshop's Run option, but a lot of extraneous information is pre-pended to the URL. If you clear this garbage (file:///Users/patshepherd/beaplat/weblogic81/workshop/) and fix the single slash just after the port number (http:/localhost:7001/GettingStarted/Controller.jpf > http://localhost:7001/GettingStarted/Controller.jpf), then the application will run and you will even be able to debug your application. This, quite frankly, can be quite a speed bump in the standard build-test development cycle (see Figure 1).
When I found that Netscape 7.1 will auto-launch, I was overjoyed. That was until I tried to hit the WebLogic Server console and found that Netscape does not load the console's applet(s) either. Figure 2 shows the path I used to register the Netscape browser to auto-launch.
In summary, the Netscape browser is your best bet to use as Workshop's auto-launched browser, but none of the browsers will load the Server console applet(s). One quirk you will notice, though, is that Netscape will not automatically notify Workshop that the debug session is over when Netscape is closed - this is normal behavior on the Windows platform. The Netscape browser can be obtained at channels.netscape.com/ns/browsers/download.jsp.
Running the Domain Configuration Tool
The Domain Configuration Tool allows you to quickly create a domain from a predefined template.While creating your domain, you will be asked to specify the directory where your JVM lives because, obviously, you are using your native Mac OS X JVM and none has been supplied as part of the generic distribution we have installed (see Figure 3).
I got my domain running by selecting the linked directory shown in the browser tree which is, as discussed earlier, a link to the /Library/Java/Home directory we fixed earlier (see Figure 4).
Tips and Tricks
Cut and PasteOne joke I always tell is that "Copy, Paste" is the world's most prevalent form of code reuse. So, you might get frustrated using the standard Apple key combination of CMD-C for "copy" or CMD-V for paste. It is worth noting that the shortcut keystrokes in Workshop are exactly the same as they would be in the Windows world where, for example, CTRL-C is the standard "copy" combination. In fact, all key combinations are the same as their Windows brethren (with the exception of things like CMD-Q for "quit").
Terminal Velocity
Now is a great time to mention a very useful feature - the ability to drag a script file from finder and drop it right into the terminal shell. No more need to type in long path and file information to execute a start script, for example. Figures 5a and 5b show the result of dragging the file "config.sh"onto the terminal shell to start the Domain Configuration Tool, but the process works equally well for launching the start scripts for WebLogic Workshop or WebLogic Server.
Summary
For developers who are interested in a Java development environment that gives them "the best of both worlds" - the best user interface coupled with the power of a very mature UNIX distribution - you should seriously consider Mac OS X. While Apple was slow to keep the JVM versions in OS 9 up to date (never made it past 1.1.8), with Mac OS X Apple is now shipping a native 1.4.2 JVM that establishes Java as a first-class citizen in the Mac world.Adding BEA's J2EE-based Application Platform Suite (APS), developers can leverage the power of Mac OS X to begin to develp world-class, service-oriented applications.
There are parts and pieces of Workshop that do not fully work on Mac OS X, but keep in mind that, as I stated earlier, Mac OS X is not currently a BEA-supported platform and has not gone through rigorous certification. With the BEA and Mac communities working together, Mac OS X could become a premiere development environment for truly serious developers. If you want to register with BEA your interest in making Mac OS X a BEA-supported platform, please e-mail Weblogic-on-osx@bea.com and Put "OS.X interest" in the subject.
Acknowledgements
I want to acknowledge some very useful postings by various users on O'Reilly Developer WebLogs hosted by BEA's Rod Chavez. There is a steady stream of postings there and interested readers should feel free to contribute to the momentum with their own postings. (www.oreillynet.com/pub/wlg/4091).
Published July 13, 2004 Reads 19,858
Copyright © 2004 SYS-CON Media, Inc. — All Rights Reserved.
Syndicated stories and blog feeds, all rights reserved by the author.
More Stories By Pat Shepherd
Pat Shepherd has been an active member of the Java revolution since its inception in 1995. He has written for several magazines and was a technical editor for the Sams book BEA WebLogic Platform 7. He has worked at BEA for more than five years and is currently a global account architect who spreads the Java/SOA message everywhere he goes.
![]() |
JavaRules 08/11/04 05:10:49 AM EDT | |||
As a recent refugees from Linux and Windows, I agree completely. Mac is a really nice environment and really ideal for Weblogic development. I would add is a small, maybe trivial, detail as illustration. The Mac comes with a wider screen geometry than is usual for PCs. This is ideal for environments such as BEA Workshop. Whenever you look at anyone working in Workshop on a PC, they tend to keep resizing the windows all the time. I even saw demonstrators doing it a keynotes at the BEA World conference. In fact all that is needed is wider screen ratio to make everything viewable. This is just a small example of things that have been thought out and there are many such details. Certainly, you could buy such a screen for your PC. Similarly, many Mac OS X features could easily be implemented in another environment. The fact is, however, that they are not, and the cummulative difference is sizable and very noticable. The point is that the system is very pleasing just out of the box, which allows you to do your work instead of constantly tailoring and reconfiguring your environment. Of course, some people love to do such things and should stick to Linux. Others love to be exploited by shameless charlatans, because they have a feeling of sharing in the glory of the exploiters, such should definitely stick to Windows and endure the sweet agony of persecution. |
||||
- What’s Next for Oracle-Sun?
- Virtualization Expo New York Call for Papers to Expire January 15, 2010
- Forget Defining Cloud Computing
- Why Cops and Java Developers Have Low Salaries?
- Sun Microsystems Releases NetBeans IDE 6.8
- TIBCO Goes to IBM Before the End of March 2010 -Prediction
- Economy Drives Adoption of Virtual Lab Technology
- Sun Microsystems Launches GlassFish Enterprise Server v3
- VMware Reportedly Buying Zimbra
- Cloud Computing Shows Promise During Navy Trident Warrior Exercise
- Cloud Computing on Windows Azure
- A Key Phase in SOA Programs Business Service Realization
- Tactical Cloud Computing Panel at 1st Annual GovIT Expo
- What’s Next for Oracle-Sun?
- Virtualization Expo New York Call for Papers to Expire January 15, 2010
- Forget Defining Cloud Computing
- Why SOA Needs Cloud Computing - Part 1
- Why Cops and Java Developers Have Low Salaries?
- The Transition to Cloud Computing: What Does It Mean For You?
- A Security Analysis of Cloud Computing
- Sun Microsystems Releases NetBeans IDE 6.8
- TIBCO Goes to IBM Before the End of March 2010 -Prediction
- Economy Drives Adoption of Virtual Lab Technology
- Sun Microsystems Launches GlassFish Enterprise Server v3
- Java vs C++ "Shootout" Revisited
- Where Are RIA Technologies Headed in 2008?
- Configuring Eclipse for Remote Debugging a WebLogic Java Application
- Migrating a JBoss EJB Application to WebLogic
- XA Transactions
- The Top 250 Players in the Cloud Computing Ecosystem
- An Introduction to Abbot
- WebLogic Tutorial: "Integrating Apache Poi in WebLogic Server"
- Eclipse "Pollinate" Project to Integrate with Apache Beehive
- Failover and Recovery of Enterprise Applications - Part 1
- Cover Story: A Practical Solution to Internationalization of a J2EE Web App
- WebSphere vs WebLogic: IBM and BEA Spar Over SPEC Results
























