Exception in thread “main” java. lang. NoClassDefFoundError : weblogic/WLST

This is my first attempt with WLST (WebLogic Scripting Tool) which is scripting tool to create , manage and monitor webLogic domains, more information here .


You can invoke WLST by running  “java weblogic.WLST

I tried this on my WebLogic Server and straight hit error

Exception in thread “main” java.lang.NoClassDefFoundError: weblogic/WLST

I soon realised that jar file which contains class weblogic.WLST is missing from classpath and quick fix is to set environment variable using setWLSEnv.sh (under WL_HOME/server/bin) . For Fusion MiddleWare (FMW) 11g, it should be under $MW_HOME/ wlserver_10.3/ server/ bin

set environemnt variable for weblogic server
cd WL_HOME/server/bin
. ./setWLSEnv.sh

$ java weblogic.WLST

Initializing WebLogic Scripting Tool (WLST) …

Welcome to WebLogic Server Administration Scripting Shell

Type help() for help on available commands


More on WLST commands coming in next posts but here are some WLST basics


1. WebLogic Scripting Tool (WLST) – is command line scripting tool to create , manage and monitor webLogic domains and resources/applications deployed on WebLogic

2. WLST is based on Jython based scripting language, which in turn is Java implementation of Python.

3. WLST is used
– To automate common tasks
– If administration console is not available or as alternative to Administration Console

4. WLST can be run in offline and online mode
a) online mode> interact with running weblogic server
b) offline mode> servers in domain should be shutdown and WLST updates directly config.xml on file system

5. If you do not supply any script file then WLST runs in interactive mode.
6.You can generate WLST scripts via WebLogic Console as well -> click on Record button on console after clicking ‘Lock and Edit’ button on change center. To end recording click on ‘Activate Changes’

wlst record


7. WLST communicates with Weblogic’s MBean to retrieve and update resources on a running server.


Learn Oracle Weblogic Server Administration


Get 100 USD OFF + 100% Money Back Guarantee

Click here to get Early Bird Discounts

About the Author Atul Kumar

Oracle ACE, Author, Speaker and Founder of K21 Technologies & K21 Academy : Oracle Gold Partner specialising in Design, Implement, and Trainings.

follow me on:

Leave a Comment:

andrew says November 30, 2009

Hi Atul,
so where is the jar file which contains class weblogic.WLST ?

Atul Kumar says December 1, 2009

@ Andrew,
Good question, welogic.WLST class is in jar file $WL_HOME/server/lib/weblogic.jar

purna chandra says November 22, 2010


For this exception we just need to set the classpath : C:\bea\wlserver_10.3\server\lib\weblogic.jar;

and path : C:\bea\wlserver_10.3\server\bin\setWLSEnv.cmd;

Purna Chandra

test says August 19, 2011

how to set classpath and where to set classpath

Atul Kumar says August 25, 2011

@ test,
To set classpath on unix


for windows

Where to set classpath?

It depends on what and how you run application which uses this classpath.

@Tech says September 21, 2011


I have set path as said above but why always need to run (. ./setWLSEnv.sh) before use it or ot should be set in setDomainEnv.sh.


ankam says February 3, 2012


For this exception we need to add the weblogic.jar to classpath
you can see the same by executing the command ENV on unix machine.
Once it is added to CLASSPATH then execute the java weblogic.WLST then your WLST will be initiate.

Weblogic_Home u will find one .profile there u can maintain all the env&CLASSPATH details.

Thirunavukkarasu says March 28, 2012


I set the environment using ./setWLSEnv.sh. I also checked the CLASSPATH variable,it’s having the needed JAR file:

But still i’m unable to resolve the issue.Error message:
[grd@cvgrhegrdt003 bin]$ java weblogic.WLST
Exception in thread “main” java.lang.NoClassDefFoundError: weblogic/WLST
Caused by: java.lang.ClassNotFoundException: weblogic.WLST
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)
Could not find the main class: weblogic.WLST. Program will exit.

Atul Kumar says March 28, 2012

@ Thirunavukkarasu,

1. Which version of Java you are using ?

which java
java -version

2. What is WebLogic Version and & Operating System version ?

Thirunavukkarasu says March 28, 2012

1.java version “1.6.0_26″
Java(TM) SE Runtime Environment (build 1.6.0_26-b03)
Java HotSpot(TM) 64-Bit Server VM (build 20.1-b02, mixed mode)

2. weblogic 10.3,GNU/Linux

Thirunavukkarasu says March 28, 2012

Hi Atul,

I need to change the mode from Interactive mode(java WLST) to Scripting Mode(java
-Dweblogic.security.TrustKeyStore=DemoTrust ]

Jitendra says October 16, 2012


Anwar Hussain says October 25, 2012

When startin Managed server, am getting this error message

[oracle@hostname bin]$

Kindly Help me

    Atul Kumar says October 25, 2012

    @ Anwar Hussain,
    Paste the error message (remove <> from logs )

ankumar1974 says November 23, 2012

Hi Atulkumar,

I am trying to invoke WLST script to create the domain using CYGWIN which in turn connects to the windows machine however it is failing with the below exception

Exception in thread “main” java. lang. NoClassDefFoundError : weblogic/WLST

I have set the classpath to weblogic.jar but it fails. Please let me know how we can set the classpath in CYGWIN in order to invoke WLST Script.

I was trying to do as below using cygwin.

java weblogic.WLST createdomain.py

Looking forward for your response.


gravik says November 25, 2014

thanks a lot, it worked for me..

Marin says September 9, 2016

Que tal, estoy haciendo un aplicación en java, pero necesito entrar a wlst solo que aunque he agregado las .jar correspondientes me manda el error,
Exception in thread “main” java.lang.RuntimeException: Could not find the OffLine WLST class
at weblogic.management.scripting.utils.WLSTUtil.getOfflineWLSTScriptPathInternal(WLSTUtil.java:88)
at weblogic.management.scripting.utils.WLSTUtil.setupOfflineInternal(WLSTUtil.java:255)
at weblogic.management.scripting.utils.WLSTUtil.setupOffline(WLSTUtil.java:234)
at weblogic.management.scripting.utils.WLSTInterpreter.(WLSTInterpreter.java:134)
at weblogic.management.scripting.utils.WLSTInterpreter.(WLSTInterpreter.java:76)
at project1.EnbeddedWLST.(EnbeddedWLST.java:17)
at project1.EnbeddedWLST.main(EnbeddedWLST.java:51)
Caused by: java.lang.ClassNotFoundException: com.oracle.cie.domain.script.jython.WLST_offline
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:305)
at java.lang.ClassLoader.loadClass(ClassLoader.java:246)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:247)
at weblogic.management.scripting.utils.WLSTUtil.getOfflineWLSTScriptPathInternal(WLSTUtil.java:81)
… 6 more

He estado investigando pero no encuentro resultado.
agradecería su ayuda.

Add Your Reply