Installing WebLogic Server on Mac OS X

One of the exciting new features in WebLogic Server 11g is support for Mac OS X.  The new ‘ZIP Distribution’ of WebLogic Server allows developers to run WebLogic Server on Mac OS X.  The download file is much smaller and the install is much faster than downloading JDeveloper, which also includes WebLogic Server that can be used on the Mac.

To install Weblogic Server on your Mac, follow these steps.

First, you need to download WebLogic Server 11g (10.3.4) ZIP Distribution from OTN.

Unzip this into new directory, which we will call MW_HOME.  I created a directory called WebLogic/Middleware in my home directory.

# mkdir ~/WebLogic
# cd ~/WebLogic
# mkdir Middleware
# cd Middleware
# unzip ../Downloads/wls1034_dev.zip 

Run the configuration script to setup WebLogic Server.

# export JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Versions/1.6/Home
# export MW_HOME=/Users/mark/WebLogic/Middleware
# ./configure.sh
# export USER_MEM_ARGS="-Xmx1024m -XX:MaxPermSize=256m"
# . wlserver/server/bin/setWLSenv.sh

Start WebLogic Server for the first time and create a domain.

# cd ~/WebLogic
# mkdir domain
# cd domain
# java –Xmx1024m –XX:MaxPermSize=256m weblogic.Server

WebLogic will notice this is the first time it has been started and will ask you if you want to create a domain.  Answer ‘y’ to this question, and then provide a username and password when requested.

Would you like the server to create a default configuration and boot? (y/n): y
Enter username to boot WebLogic server: weblogic
Enter password to boot WebLogic server: password
For confirmation, please re-enter password required to boot WebLogic server: password

WebLogic Server will start up.  When it is up you will see a message indicating that the server was started in RUNNING mode.  Once you see this, you can shut it down (type Ctrl-C).

You can now use the startup scripts in your newly created domain.  When you want to start WebLogic Server, enter the following commands (you might want to create a script to do this):

# export JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Versions/1.6/Home
# export MW_HOME=/Users/mark/WebLogic/Middleware
# export USER_MEM_ARGS="-Xmx1024m -XX:MaxPermSize=256m"
# . /Users/mark/WebLogic/Middleware/wlserver/server/bin/setWLSenv.sh
# /Users/mark/WebLogic/domain/startWebLogic.sh

Note:  If you copy and paste this, you may need to make sure that characters like “ and – are correct – when I pasted into terminal I got some incorrect characters.  You may also want to adjust the memory settings to suit your machine, and you might want to consider some of the other recommended JVM settings here.

You can now log on to the WebLogic Server console at http://yourmac:7001/console

Enjoy!

About Mark Nelson

Mark Nelson is a Developer Evangelist at Oracle, focusing on microservices and messaging. Before this role, Mark was an Architect in the Enterprise Cloud-Native Java Team, the Verrazzano Enterprise Container Platform project, worked on Wercker, WebLogic and was a senior member of the A-Team since 2010, and worked in Sales Consulting at Oracle since 2006 and various roles at IBM since 1994.
This entry was posted in Uncategorized and tagged , . Bookmark the permalink.

5 Responses to Installing WebLogic Server on Mac OS X

  1. Pingback: Deploying WebLogic applications with Maven | RedStack

  2. Pingback: Improving JMS Performance on WebLogic | RedStack

  3. Hello,

    I have been trying to install weblogic on my macosx 10.7.5, I tried a lot of options but none worked.Finally I found and decided to follow your tutorial using the distribution zip. Some how, when I run “java –Xmx1024m –XX:MaxPermSize=256m weblogic.Server” it cannot locate it:

    Gustavos-MacBook-Pro:domain gustavoazevedo$ java -Xmx1024m -XX:MaxPermSize=256m weblogic.Server
    Exception in thread “main” java.lang.NoClassDefFoundError: weblogic/Server
    Caused by: java.lang.ClassNotFoundException: weblogic.Server
    at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
    Gustavos-MacBook-Pro:domain gustavoazevedo$

    Can you help me?

  4. Thanks for this very helpful guide! Along the way, I found a couple issues I had to solve to get it all set up on my Mac:

    1: When I tried to run:
    java -Xmx1024m -XX:MaxPermSize=256m weblogic.Server
    I got this error:

    Exception in thread “main” java.lang.AssertionError: JAX-WS 2.2 API is required, but an older version was found in the JDK.
    Use the endorsed standards override mechanism (http://java.sun.com/javase/6/docs/technotes/guides/standards/).
    1) locate the bundled Java EE 6 endorsed directory in $WL_HOME/endorsed.
    2) copy those JAR files to $JAVA_HOME/jre/lib/endorsed OR add the endorsed directory to the value specified by system property java.endorsed.dirs.
    at utils.ValidateJavaEE6EndorsedOverrides.validateLib(ValidateJavaEE6EndorsedOverrides.java:55)
    at utils.ValidateJavaEE6EndorsedOverrides.validateEndorsedOverrides(ValidateJavaEE6EndorsedOverrides.java:32)
    at weblogic.Server.main(Server.java:61)

    I found that the solution was not just to put those JARs in the $JAVA_HOME/jre/lib/endorsed directory, but to put them in the $JAVA_HOME/lib/endorsed directory.

    Also, when I tried to run startWebLogic.sh, I got this error:

    The JRE was not found in directory . (JAVA_HOME)
    Please edit your environment and set the JAVA_HOME
    variable to point to the root directory of your Java installation.

    This, despite the fact that I had set up the JAVA_HOME variable already. Turns out the setDomainEnv.sh script had SUN_JAVA_HOME=”” and was defaulting to it. Setting SUN_JAVA_HOME to the default value of JAVA_HOME fixed this for me.

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s