<PAGE>   1
                                                                    EXHIBIT 10.1

                               SUBLEASE AGREEMENT

1. PARTIES.

        THIS SUBLEASE AGREEMENT (the "Sublease") is made and entered into as of
this 23 day of June, 2000, by and between BEA SYSTEMS, INC., a Delaware
corporation, ("Sublandlord") and WEBGAIN, INC., a Delaware corporation
("Subtenant").

2. FACTS.

        Sublandlord, as tenant, entered into a certain Lease dated April 3, 2000
(the "Master Lease") with Compaq Computer Corporation, as landlord ("Landlord")
for the leasing of a building commonly known and addressed as 5425 Stevens Creek
Blvd., Santa Clara, California 95051, as more particularly described in Section
3 and Exhibit A of the Master Lease (the "Premises").

        Sublandlord desires to sublet to Subtenant, and Subtenant desires to
sublease from Sublandlord a portion of the Premises (as more particularly
defined below), in accordance with the terms and conditions of this Sublease.

        In consideration of the covenants and agreements set forth herein, and
for other good and valuable consideration, the receipt and sufficiency of which
are hereby acknowledged, Sublandlord and Subtenant covenant and agree as set
forth below.

3. DEMISE AND TERM

        Sublandlord subleases to Subtenant, and Subtenant subleases from
Sublandlord, the area consisting of 28,786 rentable square feet shown on the
floor plan attached as Exhibit "A" attached hereto (the "Subleased Premises"),
which comprises the entirety of floors three (3) and four (4) and certain common
areas of the Building having a total rentable area of 59,367 square feet plus 94
square feet of Shared Area (the "Building"). For the purposes of this Sublease,
it is agreed that the rentable area of the Subleased Premises and the rentable
area of the Building shall be as stated in this Section 3(a) and no variation
between such stated rentable areas and the actual rentable areas of the
Subleased Premises and/or the Building shall alter or affect the rights and
obligations of Sublandlord and Subtenant under this Sublease.

        The term of this Sublease (the "Sublease Term") shall commence on June
26, 2000 (the "Commencement Date"). The Sublease Term shall end on the earliest
to occur of (a) 11:59 p.m. on March 31, 2003 , (the "Expiration Date"), (b) the
date the Sublease is sooner terminated pursuant to its terms, or (c) the date
the Master Lease is sooner terminated pursuant to its terms.

4. BASE RENT AND ADDITIONAL RENT

        Subtenant shall pay to Sublandlord base monthly rent ("Base Monthly
Rent") for the Subleased Premises in advance without prior notice, demand,
set-off, deduction or abatement in accordance with the following schedule:



                                       1
<PAGE>   2

<TABLE>
<CAPTION>
-----------------------------------------------------------------------------------
Period                       Monthly gross Rental rate per      Monthly Installment
                                 rentable square foot
<S>                          <C>                                <C>
-----------------------------------------------------------------------------------
Commencement through 3/31/01            $5.00                       $143,930.00
      4/1/01 through 3/31/02            $5.20                       $149,687.20
      4/1/02 through 3/31/03            $5.41                       $155,732.26
-----------------------------------------------------------------------------------
</TABLE>


        The sum of $143,930.00 shall be payable by Subtenant upon the execution
of this Sublease as Monthly Base Rent for the first full calendar month of the
Sublease Term. Except for the payment due upon execution of this Sublease,
Monthly Base Rent shall be due payable by Subtenant on or before the first day
of each calendar month during the Sublease Term and prorated for any partial
month.

        Commencing on the Commencement Date and through the remainder of the
Sublease Term, Subtenant shall pay Subtenant's Proportionate Share (as defined
below) of all costs and expenses payable by Sublandlord under the Master Lease.

        "Subtenant's Proportionate Share" shall be forty-eight and forty-five
one hundredths percent (48.45%). If during the Sublease Term there is a change
in the rentable area of either the Subleased Premises or the Premises, then
Subtenant's Proportionate Share shall be recalculated by dividing the revised
rentable area of the Subleased Premises by the revised rentable area of the
Premises.

        Subtenant shall pay to Sublandlord, within ten (10) days after invoice
therefor by Sublandlord Subtenant's Proportionate Share of all costs and
expenses ("Expenses") payable by Sublandlord under the Master Lease. Sublandlord
shall have the right to estimate such Expenses from time to time, as reasonably
determined by Sublandlord and communicated to Subtenant, and Subtenant shall pay
to Sublandlord together with each payment of Monthly Base Rent, a sum equal to
one-twelfth (1/12th) of Subtenant's Proportionate Share of the then estimated
Expenses. If Sublandlord estimates such Expenses, then within one hundred twenty
(120) days after the end of each calendar year during the Sublease Term,
Sublandlord shall furnish Subtenant with a statement setting forth the actual
Expenses for such calendar year. If the actual Expenses for such calendar year
exceed the amount theretofore estimated, Subtenant shall pay to Sublandlord,
within twenty (20) days after Sublandlord has furnished Subtenant with the
statement described above, Subtenant's Proportionate Share of the excess of the
actual Expenses for such calendar year over and above the estimated Expenses.
Conversely, if the Expenses for such calendar year are less than the amount
theretofore estimated, Sublandlord shall (1) apply such excess to any amount
then owed by Subtenant to Sublandlord, or (2) credit the difference against the
next payment of Monthly Base Rent due under this Sublease, or (3) if the
Sublease Term has ended, pay such excess to Subtenant within twenty (20) days
after Sublandlord has furnished Subtenant with the statement described above.
Sublandlord may by notice to Subtenant change the estimated amount of Expenses,
in which case an appropriate payment or credit shall be made by one party to the
other within twenty (20) days after Sublandlord's notice of such change, so that
Tenant's estimated payments for the then current calendar year match Tenant's
Proportionate Share of the revised estimated Expenses for such year.

        Sublandlord will maintain accurate books and records necessary for the
determination and confirmation of the Expenses in accordance with normal
business practices, which records are to be kept for not less than two (2) years
after the calendar year to which they relate. Upon reasonable advance notice,
Subtenant shall be permitted to designate an independent certified public
accountant, reasonably approved by Sublandlord, to audit Sublandlord's books and
records. If such audit discloses any material discrepancy between Sublandlord's
prior statements of Expenses, appropriate adjustment shall be made in any
payments made by or due from Subtenant hereunder. No such audit may be conducted
with respect to a particular calendar


                                       2
<PAGE>   3

year more than six (6) months after delivery of Sublandlord's statement of
actual Expenses for such calendar year, unless Landlord thereafter delivers a
corrected statement of actual Expenses (in which case the deadline for
Subtenant's audit shall be extended to three (3) months after Sublandlord's
delivery of the corrected statement). No person conducting such audit shall be
compensated, in whole or part, based on the outcome of such audit.

        All amounts other than Monthly Base Rent which are payable by Subtenant
to Sublandlord pursuant to this Sublease shall be "Additional Rent," and
references in this Sublease to "Rent" shall mean both Monthly Base Rent and
Additional Rent. If any Rent due hereunder from Subtenant is not paid when due,
Subtenant shall be charged a late fee equal to five percent (5%) of the
delinquent amount. Said late fee shall be payable as Additional Rent and neither
Sublandlord's demand for nor collection of such late fee shall preclude
Sublandlord's exercise of all other rights and remedies arising on account of
such late payment. Subtenant acknowledges that the actual damages sustained by
virtue of late payment of Rent would be difficult or impractical to determine
and that the late fee provided above represents a reasonable estimate of such
damages.

        Subtenant shall pay before delinquency all taxes and assessments levied
against Subtenant's personal property and trade or business fixtures and all
fees and charges for utilities and services supplied to the Subleased Premises
in addition to the utilities and services provided under the Master Lease.

        Subtenant shall reimburse Sublandlord for Subtenant's Proportionate
Share of Sublandlord's costs of improving the Building, including, without
limitation, painting and patching of walls and doors, installation of security
system and related doors and electrical work, installation of telephone and data
cabling and any other costs reasonably related to making the Building ready for
occupancy for Subtenant. Such reimbursement shall be payable by Subtenant to
Sublandlord within thirty (30) days after invoice to Subtenant.

5. INCORPORATION OF MASTER LEASE PROVISIONS

        This Sublease is and shall remain subject and subordinate to the Master
Lease. Sublandlord and Subtenant shall not commit or permit to be committed on
the Subleased Premises any act or omission which shall violate any term or
condition of the Master Lease. Subtenant hereby expressly assumes and agrees to
observe, perform and otherwise comply with all covenants and obligations of the
Master Lease which pertain to the Subleased Premises (other than the obligation
to pay Rent) which are assumed by Subtenant hereunder the Sublease Term.

        Subject to the exclusions, limitations and modifications herein below
set forth, the terms, covenants and conditions of the Master Lease are
incorporated in this Sublease by reference so that, except to the extent that
they are excluded, limited or otherwise modified by the provisions of this
Sublease for the purpose of incorporation by reference, each and every term,
covenant and condition of the Master Lease binding or inuring to the benefit of
the Landlord thereunder shall, in respect of this Sublease, bind or inure to the
benefit of Sublandlord, and each and every term, covenant and condition of the
Master Lease binding or inuring to the benefit of the tenant thereunder shall,
in respect of this Sublease, bind or inure to the benefit of Subtenant, with the
same force and effect as if such terms, covenants and conditions were completely
set forth in this Sublease, and as if the words "Landlord" and "Tenant," or
words of similar import, wherever the same appear in the Master Lease, were
construed to mean, respectively, "Sublandlord" and "Subtenant" in this Sublease,
and as if the word "Premises," or words of similar import, wherever the same
appear in the Master Lease, were construed to mean "Subleased Premises" in this
Sublease, and as if the word "Lease;" or words of similar import, wherever the
same appear in the Master Lease, were construed to mean this "Sublease."
Subtenant represents that it has examined, read and is thoroughly familiar with
the terms, covenants and conditions of the Master


                                       3
<PAGE>   4

Lease, and accepts those terms, covenants and conditions and obligations thereof
which have been incorporated herein.

        The following sections of the Master Lease are not incorporated as a
part of this Sublease and are expressly excluded herefrom (except insofar as
the same may be referenced elsewhere in this Sublease for purposes of
identification or definition of certain matters): 1; 3.1; 3.4; 4.1; 4.3; 4.4; 5;
6; the first sentence of 7.1; the first sentence of 7.2; 7.3; 18; 32; 38; and
Exhibit H.

        The following limitations shall apply to the interpretation and
enforcement of the incorporated terms, covenants and conditions of the Master
Lease:

        The time limits contained in the Master Lease for the giving of notices,
making of demands or performing of any act, condition or covenant on the part of
the Tenant thereunder, or for the exercise by the Tenant thereunder of any
right, remedy or option, are changed for the purposes of incorporation herein by
reference by shortening the same in each instance by two (2) business days, so
that in each instance Subtenant shall have two (2) business days less time to
observe or perform hereunder than Sublandlord has as the Tenant under the Master
Lease.

        Any non-liability, release, indemnity or hold harmless provision, and
any provisions pertaining to waiver of subrogation rights and or the naming of a
party under an insurance policy, in the Master Lease for the benefit of
Landlord, that is incorporated herein by reference, shall be deemed to inure to
the benefit of Sublandlord and Landlord for the purpose of incorporation by
reference in this Sublease.

        Any right of the Landlord or access or inspection and any right of the
Landlord under the Master Lease to do work in the Subleased Premises under the
Master Lease or in the Premises and any right of the Landlord in respect of
rules and regulations shall be deemed to inure to the benefit of Sublandlord and
the Landlord, for the purpose of incorporation by reference in this Sublease.

        If any of the express provisions of this Sublease shall conflict with
any of the provisions incorporated by reference, such conflict shall be resolved
in every instance in favor of the express provisions of this Sublease. If any
incorporated provision of the Master Lease cross-references a provision of the
Master Lease, which is not incorporated in this Sublease, such cross-referenced
Master Lease provision shall be disregarded except to the extent required for a
fair and equitable interpretation of the incorporated Master Lease provision.

        Any obligation of Sublandlord which is contained in this Sublease by the
incorporation by reference of the provisions of the Master Lease shall be
observed or performed by Sublandlord using reasonable good faith efforts to
cause the Landlord under the Master Lease to observe and/or perform the same,
and Sublandlord shall have a reasonable time to enforce its rights to cause such
observance or performance. Sublandlord shall not be required to furnish, supply
or install anything under any provision of the Master Lease. Subtenant shall not
in any event have any rights in respect of the Subleased Premises greater than
Sublandlord's rights under the Master Lease, and notwithstanding any provision
to the contrary, as to obligations that pertain to the Subleased Premises and
are contained in this Sublease by the incorporation by reference of the
provisions of the Master Lease, Sublandlord shall not be required to make any
payment or perform any obligation, and Sublandlord shall have no liability to
Subtenant for any matter whatsoever, except for Sublandlord's obligation to pay
the rent and additional rent due under the Master Lease and for Sublandlord's
obligation to use reasonable good faith efforts, upon request of Subtenant, to
cause the Landlord under the Master Lease to observe and/or perform Landlord's
obligations under the Master Lease. Sublandlord shall not be responsible for any
failure or interruption, for any reason whatsoever, of the services or
facilities that may be appurtenant to or supplied at the Premises by the
Landlord.



                                       4
<PAGE>   5

        With respect to any approval or consent required to be obtained from
Landlord under the Master Lease, such approval or consent must be obtained from
both Landlord and Sublandlord, and the approval of Sublandlord may be withheld
if Landlord's approval or consent is not obtained.

        Notwithstanding the incorporation of specific terms, covenants and
conditions of the Master Lease into this Sublease, such incorporated terms,
covenants and conditions have in instances been further modified or amended as
more particularly stated within the terms of this Sublease, including, without
limitation, the following modifications:

        The remedies available to Sublandlord in case of Subtenant's default, as
set forth in Section 19 of the Master Lease, shall include (without limitation)
those provided in California Civil Code Sections 1951.2 and 1951.4. Furthermore,
the notice and cure periods set forth in Section 19.1 of the Master Lease shall
reduced from five (5) business days and thirty (30) days, respectively, to three
(3) business days and fifteen (15) days.

        If the Subleased Premises are not surrendered at the Expiration Date or
sooner termination of this Sublease in the condition required by the Master
Lease, Subtenant shall be deemed in a holdover tenancy pursuant to this Section
and Subtenant shall indemnify, defend, and hold Landlord and Sublandlord
harmless against loss or liability resulting from delay by Subtenant in so
surrendering the Subleased Premises including, without limitation, any claims
made by any succeeding tenant founded on such delay and costs incurred by
Landlord and Sublandlord in returning the Premises and the Subleased Premises to
the required condition, plus interest. Any holding over after the termination or
Expiration Date with Sublandlord's express written consent, shall be construed
as month-to-month tenancy, terminable on thirty (30) days written notice from
either party, and Subtenant shall pay as Base Monthly Rent to Sublandlord a rate
equal to one hundred fifty percent (150%) of the Base Monthly Rent due in the
month preceding the termination or Expiration Date, plus all other amounts
payable by Subtenant under this Sublease. Any holding over shall otherwise be on
the terms and conditions herein specified, except those provisions relating to
the Master Lease and this Sublease. If Subtenant remains in possession of the
Subleased Premises after the Expiration Date or sooner termination of this
Sublease without Sublandlord's consent, Subtenant's continued possession shall
be on the basis of a tenancy at sufferance and Tenant shall pay as rent during
the holdover period an amount equal to two hundred percent (200%) of the Base
Monthly Rent due in the month preceding the termination or Expiration Date, plus
all other amounts payable by Subtenant under this Sublease. This provision shall
survive the termination or expiration of the Master Lease and this Sublease.

        Any notice by Subtenant of a failure by Sublandlord to perform its
obligations under this Sublease shall be delivered both to any party requested
by Sublandlord in writing, and also to Landlord.

6. UTILITIES AND SERVICES

        Subtenant shall not, except with Sublandlord's prior written consent,
which consent may be withheld in Sublandlord's sole discretion, either: (i) use
any apparatus or device in the Subleased Premises which will increase the amount
of cooling, ventilation, electricity or water supplied to the Subleased Premises
beyond that usually supplied for general office use; or (ii) connect with
electric current or water pipes any device or apparatus for the purpose of using
electrical current or water, except as such connections now exist. If
Sublandlord consents to the use and/or connection of any apparatus or device
described in clauses (i) and (ii) above, Sublandlord may install meters or
similar monitoring devices to measure the amount of utilities consumed by such
apparatus or devices and Subtenant shall pay for the cost of all work and
materials required for the installation, maintenance and use of such meters and
monitoring devices. If Sublandlord elects not to install a special meter or
monitoring device, Sublandlord shall


                                       5
<PAGE>   6


determine the amount of additional utilities and resources consumed by such
apparatus or device based upon Sublandlord's reasonable estimates and best
judgment, and such determination, made in good faith by Sublandlord, shall be
conclusive on Subtenant. Subtenant shall pay to Sublandlord promptly upon demand
the cost of any excess use of utilities and resources based on the rates charged
by the local public utility company or other supplier furnishing same, plus any
additional expense incurred by Sublandlord in keeping account of the foregoing
and administering same.

        Sublandlord shall not be in default under this Sublease or liable for
any damages directly or indirectly arising from, nor shall the rent be abated by
reason of, any failure to provide or any reduction in any of the above services
or utilities if such failure or reduction is caused by the making of repairs or
improvements to the Premises or the Building, the installation of equipment,
acts of God or the elements, labor disturbances of any character, or any other
events or conditions whatsoever beyond the reasonable control of Sublandlord, or
rationing or restrictions on the use of said services and utilities due to
energy shortages or other causes, whether or not any of the above result from
acts or omissions of Sublandlord. Furthermore, Sublandlord shall be entitled to
cooperate voluntarily in a reasonable manner with the efforts of national, state
or local governmental bodies or utilities suppliers in reducing energy or other
resources consumption. The failure of Sublandlord to provide the utilities and
services specified in this Section shall not constitute a constructive or other
eviction of Subtenant.

        Subtenant shall pay prior to delinquency for all telephone and all other
materials and services not expressly required to be provided by Sublandlord,
which may be furnished to or used in, on or about the Subleased Premises during
the Sublease Term.

        7. USE AND CONDITION OF PREMISES

        Subtenant shall use the Subleased Premises exclusively for general
purposes, research and development not involving regulated hazardous materials,
marketing, ancillary storage and other incidental uses, and Subtenant shall not
use, or permit or suffer the Subleased Premises to be used, for any other use or
purpose without first obtaining Sublandlord's written approval of any change in
Subtenant's use. Sublandlord makes no representation, warranty or other
assurance to Subtenant that such use of the Subleased Premises as is authorized
by this Sublease is permitted under applicable zoning and other laws, and
Subtenant assumes all risk pertaining thereto.

        Subtenant shall be permitted during the Sublease Term to use up to
eighty-eight (88) parking spaces in the Building Common Area designated by
Sublandlord and Landlord as serving the Building. Such parking shall be on a
non-exclusive basis unless Sublandlord elects to designate specific parking
areas for use by Sublandlord, Subtenant and other subtenants or occupants of the
Building.

        Subtenant shall at all times observe and comply with the rules and
regulations for the Building as set forth in the Master Lease and in this
Sublease. Sublandlord shall not be liable to Subtenant for the failure of any
other occupant of the Building to observe and comply with such rules and
regulations.

8. ASSIGNMENT AND FURTHER SUBLETTING

        Subtenant shall not sell, assign, mortgage, pledge, hypothecate,
encumber or otherwise transfer this Sublease or any interest therein, and shall
not sub-sublet the Subleased Premises or any part thereof, or suffer or permit
the Subleased Premises or any part thereof to be occupied by any other person
(the employees of Subtenant excepted), without the prior written consent of
Sublandlord and Landlord in each instance; and any attempt to do so without such
consent shall


                                       6
<PAGE>   7

be voidable and, at Sublandlord's election, shall constitute a noncurable
default under this Sublease. No interest of Subtenant in this Sublease or the
Subleased Premises shall be assignable by operation of law. Subject to the terms
and conditions contained in this section, Sublandlord shall not unreasonably
withhold its consent to a voluntary assignment of this Sublease or a subletting
of the Subleased Premises.

        If Subtenant desires at any time to assign this Sublease or to sublet
the Subleased Premises or any portion thereof, Subtenant shall submit to
Sublandlord at least thirty (30) days prior to the proposed effective date of
the assignment or sub-sublease, in writing: (i) a notice of intent to assign or
sub-sublease, setting forth the proposed effective date thereof; (ii) the name
of the proposed assignee or sub-subtenant; (iii) the nature of the proposed
assignee's or subsubtenant's business to be carried on in the Subleased
Premises; (iv) the terms and provisions of the proposed assignment or
sub-sublease; and (v) such financial information as Sublandlord and Landlord may
request concerning the proposed assignee or sub-subtenant, including recent
financial statements and bank references.

        All assignment or sub-sublease agreements shall (i) contain such terms
as are described in Subtenant's notice under this Section or as otherwise agreed
by Sublandlord, (ii) prohibit further assignments or sub-subleases except with
Sublandlord's written consent, (iii) impose the same obligations and conditions
on the assignee or sublessee as are imposed on Subtenant by this Sublease
(except as to rent and term or as otherwise agreed by Sublandlord), (iv) be
expressly subject and subordinate to each and every provision of this Sublease,
(v) have a term that expires on or before the Expiration Date or upon earlier
termination of this Sublease for any reason, (vi) provide that Subtenant and/or
the assignee or sub-sublessee shall pay Sublandlord the amount of any additional
costs or expenses incurred by Sublandlord for repairs, maintenance or otherwise
as a result of any change in the nature of occupancy caused by the assignment or
sub-sublease, and (vii) if a portion of the Subleased Premises are being
sub-subleased, provide for a legally divisible sub-sublease premises.

        Sublandlord shall be entitled to receive all Bonus Rent payable in
connection with any assignment or sub-sublease (subject to payment by
Sublandlord to Landlord of the percentage of such Bonus Rent as deemed to be
Excess Rent under the Master Lease. Within fifteen (15) days after written
request by Sublandlord, Subtenant shall provide and certify to Sublandlord all
financial information required for the calculation of Bonus Rent. "Bonus Rent"
means all sums received by Subtenant in consideration for the assignment or
sub-sublease (including the fair market value, measured in dollars, of any
non-cash consideration) in excess of the Rent payable under this Sublease
(prorated in case of a partial sub-sublease).

        If Sublandlord or Landlord retains the services of an attorney to review
any aspect of the proposed assignment or sub-sublease transaction, Subtenant
shall pay to Sublandlord and/or Landlord all attorneys' fees reasonably incurred
by them in connection therewith. Subtenant shall pay such attorneys' fees to
Sublandlord and/or Landlord within thirty (30) days after written request
therefor.

        No consent of Sublandlord to any assignment or sub-subletting by,
Subtenant shall relieve Subtenant of the obligations to be performed by
Subtenant under this Sublease, whether accruing before or after such assignment
or sub-subletting, and notwithstanding any subsequent modification, extension or
renewal of this Sublease made with or without Subtenant's consent. The consent
by Sublandlord and Landlord to any transfer or sub-subletting shall not relieve
Subtenant from the obligations to obtain Sublandlord's and Landlord's express
prior written consent to any other transfer or sub-subletting. The acceptance by
Sublandlord of payment from any other person shall not be deemed to be a waiver
by Sublandlord of any provision of this Sublease or to be a consent to any
transfer or sub-sublease, or to be a release of Subtenant from any obligation
under this Sublease. If this Sublease is assigned, or if the Subleased Premises
or

                                       7
<PAGE>   8


any part thereof is sub-sublet or occupied by any person other than Subtenant,
Sublandlord may, after default by Subtenant, collect the rent from any such
assignee, transferee, sub-subtenant or occupant and apply the net amount
collected to the Rent reserved herein, and no such action by Sublandlord shall
be deemed a consent to such assignment, transfer, sub-sublease or occupancy.

        Each assignee of Subtenant shall assume all obligations of Subtenant
under this Sublease and shall be and remain liable jointly and severally with
Subtenant for the payment of the Rent and the performance of all the terms,
covenants, conditions and agreements herein contained on Subtenant's part to be
performed for the Sublease Term. No assignment shall be binding on Sublandlord
unless the assignee or Subtenant delivers to Sublandlord a counterpart of the
assignment instrument in recordable form which contains a covenant of assumption
by the transferee satisfactory in substance and form to Sublandlord, consistent
with the requirements of this section. The failure or refusal of any assignee to
execute such instrument of assumption shall not release or discharge the
assignee from its liability to Sublandlord hereunder. Sublandlord shall have no
obligation whatsoever to perform any duty to or respond to any request from any
sub-sublessee, it being the obligation of Subtenant to administer the terms of
its subleases.

        If Subtenant is a privately held corporation, or is an unincorporated
association, limited liability company or partnership, the transfer, assignment
or hypothecation of any stock or interest in such corporation, association,
limited liability company or partnership in the aggregate from the date of this
Sublease in excess of fifty percent (50%) shall be deemed an assignment or
transfer within the meaning of this section. However, nothing in this section
shall prohibit Subtenant from assigning this Sublease or sub-subletting the
Subleased Premises or any part thereof to any of the following: (a) a
subsidiary, affiliate, division or corporation controlling, controlled by or
under common control with Tenant; (b) a successor corporation related to Tenant
by merger, consolidation, or non-bankruptcy reorganization, (c) a purchaser of
substantially all of Tenant's assets located at the Premises, or (d) in the case
of a public offering of the stock of Tenant, the purchasers of Tenant's capital
stock ("AFFILIATE"). For purposes of the preceding sentence, the term "CONTROL"
means owning directly or indirectly fifty percent (50%) or more of the
beneficial interest in such entity, or having the direct or indirect power to
control the management policies of each person or entity, whether through
ownership, by contract or otherwise. Subtenant agrees to inform Sublandlord in
writing within thirty (30) days of any assignment or other transfer permitted
under this paragraph, and such subletting or assignment shall not release or
discharge Subtenant from any liability under this Sublease.

        Sublandlord reserves the option, to be exercised by giving notice to
Subtenant within fifteen (15) days after receipt of Subtenant's notice of intent
to assign or sub-sublease to a third party other than an Affiliate (it being
agreed that no revocation or withdrawal by Subtenant of such notice of intent to
assign or sub-sublease shall affect Sublandlord's option) to recapture the
portion of the Subleased Premises described in Subtenant's notice for the
remainder of the Term, and to terminate this Sublease with respect to such
recaptured Subleased Premises. The effective date of such recapture and
termination shall be as specified in Sublandlord's notice of exercise of its
recapture option, but shall not be less than thirty (30) days nor more than
sixty (60) days after the delivery of such notice. The option to recapture
reserved to Sublandlord hereunder shall also arise in the event Subtenant shall,
voluntarily or involuntarily, sell, assign, mortgage, pledge, encumber or
otherwise transfer this Sublease or any interest herein, or sub-sublet the
Subleased Premises or any portion thereof, or suffer or permit the Subleased
Premises to be occupied by any third person (the employees of Subtenant
excepted), without first obtaining the written consent of Sublandlord; and in
such event the recapture option shall apply to the entire Subleased Premises and
be exercisable by Sublandlord at any time after the occurrence of the event for
which Sublandlord's consent was required by not obtained by Subtenant. If this
Sublease is terminated pursuant to Sublandlord's recapture option with respect
to only a portion of the Subleased Premises, the Monthly Base Rent required
under this Sublease and Subtenant's


                                       8
<PAGE>   9
 Proportionate Share of Expenses shall be adjusted proportionately based on the
rentable square footage retained by Subtenant and the rentable square footage of
the Subleased Premises immediately prior to such recapture and cancellation, and
Sublandlord and Subtenant shall thereupon execute an amendment of this Sublease
in accordance therewith. If Sublandlord so recaptures a portion of the Subleased
Premises, it shall construct and erect at its sole cost such partitions as may
be required to sever the space retained by Subtenant from the space recaptured
by Sublandlord; provided, however, that Subtenant shall bear the cost of
painting, covering or otherwise decorating the surfaces of such partitions which
face the remaining Subleased Premises. Sublandlord may, without limitation,
Sublease the recaptured portion of the Subleased Premises to the proposed
sub-subtenant or assignee, on the same or different terms as were proposed by
Subtenant, without liability to Subtenant.

        Subtenant's sole remedy in case of Sublandlord's failure to act
reasonably in regard to consenting to an assignment or further subletting shall
be specific performance and/or injunctive relief; and Subtenant waives any claim
to damages or defense to enforcement of this Sublease by virtue of Sublandlord's
failure to act reasonably in regard to a proposed assignment or further
subletting. Without limiting the grounds upon which Sublandlord reasonably may
withhold consent to an assignment or further subletting, Subtenant agrees it
will be reasonable for Sublandlord to withhold consent where:

            The proposed assignee or sub-subtenant is a governmental agency or
authority, or is a direct competitor of Sublandlord;

            The proposed assignee or sub-subtenant is a business competitor of
Landlord as determined by Landlord in its sole and absolute discretion;

            The proposed assignee or sub-subtenant currently is an occupant of
the Building, or is someone with whom Sublandlord is negotiating to sublease
part of the Building;

            The proposed assignee or sub-subtenant has a tangible net worth
which is less than the tangible net worth of Subtenant as of the date of this
Sublease.

9. SECURITY DEPOSIT

        Sublandlord hereby acknowledges receipt from Subtenant the sum of Two
hundred ninety-seven thousand seventy and no/100 Dollars ($297,070.00), which
Sublandlord shall retain as security for performance by Subtenant of each of its
obligations hereunder. If Subtenant fails at any time to perform its obligations
hereunder, Sublandlord may at its option apply the Security Deposit, or so much
thereof as is required, to cure Subtenant's default, but if prior to the
expiration or termination of this Master Lease, Sublandlord depletes the
Security Deposit in whole or in part, Subtenant shall immediately restore the
amount so used by Sublandlord. The Security Deposit shall not bear interest for
the benefit of Subtenant and may be commingled with the funds of Sublandlord,
and unless Sublandlord uses the same to cure a default of Subtenant under the
Sublease, or to restore the Subleased Premises to the condition that Subtenant
is required to leave at the conclusion of the term of this Sublease, Sublandlord
shall within thirty (30) days of the expiration or termination of this Sublease,
refund to Subtenant so much of the Security Deposit as it continues to hold
provided Subtenant has provided Sublandlord a forwarding address.

10. NOTICES

        All notices required or permitted to be given hereunder or under
applicable law shall be in writing and shall be deemed served at the earlier of
(i) personal delivery (ii) the next business day when deposited with a reputable
overnight delivery service, transit prepaid (such as, but not


                                       9
<PAGE>   10

limited to, DHL, Federal Express and Airborne), or (iii) three (3) days after
being sent by United States certified mail, postage paid, return receipt
requested, to the following addresses:

              IF TO SUBLANDLORD:

                       BEA Systems, Inc.
                       2315 North First Street
                       San Jose, California 95131
                       Attn.: Vice President, Real Estate and Corporate Services

                       With a copy to:

                       BEA Systems, Inc.
                       2315 North First Street
                       San Jose, California 95131
                       Attn.: General Counsel

              IF TO SUBTENANT:

                       WebGain, Inc.
                       5425 Stevens Creek Boulevard
                       Santa Clara, California 95051
                       Attention: Joe Menard

or to such addresses as the respective parties may from time to time designate
in writing in accordance with the terms of this Section 10.

11. SUBORDINATION AND ATTORNMENT

        Upon the written request of Sublandlord or Landlord, Subtenant will in
writing subordinate its rights under this Sublease to the lien of any mortgage
or deed of trust now or hereafter in force against the Subleased Premises, the
Premises, the Building or the underlying land and to all advances made or
hereafter to be made upon the security thereof, and to all extensions,
modifications and renewals thereunder. Subtenant shall also, upon Sublandlord's
request, subordinate its rights hereunder to any ground or underlying lease,
which may hereafter be executed affecting the Building and/or the underlying
land. Subtenant shall not subordinate its rights hereunder to any lien other
than that of a first mortgage or first deed of trust, except with the prior
written consent of the Mortgagee holding such first mortgage or deed of trust.

        Upon the written request of Landlord or any mortgagee or any lessor
under a ground or underlying lease, Subtenant shall attorn to Landlord or such
mortgagee or ground or underlying lessor, provided Landlord or such mortgagee or
lessor agrees that if Subtenant is not in default under this Sublease,
Subtenant's possession of the Subleased Premises in accordance with the terms of
this Sublease shall not be disturbed. Such agreement shall provide, among other
things, (a) that this Sublease shall remain in full force and effect, (b) that
Subtenant pay rent to Landlord or such mortgagee or lessor from the date of said
attornment, (c) that Landlord or such mortgagee or lessor shall not be
responsible to Subtenant under this Sublease except for obligations accruing
subsequent to the date of such attornment, and (d) that Subtenant, in the event
of foreclosure or a deed in lieu thereof or a termination of the ground or
underlying lease, will enter into a new lease with Landlord or such mortgagee,
lessor or other person having or acquiring title on the same terms and
conditions as this Sublease and for the balance of the Sublease Term.

        If any lender should require any modification of this Sublease as a
condition of loans secured by a lien on the Premises, the Building or the land
underlying the Building, or if any such


                                       10
<PAGE>   11
modification is required as a condition to a ground or underlying lease,
Subtenant will approve and execute any such modifications, promptly after
request by Sublandlord provided no such modification shall relate to the rent
payable hereunder, the length of the Term or otherwise materially change the
rights or obligations of Sublandlord or Subtenant.

12. BINDING EFFECT

        Subject to the limitations expressed in Section 8 above and this
Section, the covenants and agreements herein contained shall bind and inure to
the benefit of Sublandlord, Subtenant, and their respective executors,
administrators, successors and assigns.

        In the event of any assignment or transfer of the Sublandlord's interest
under the Master Lease, which assignment or transfer may occur at any time
during the term hereof, as between Sublandlord and Subtenant, Sublandlord shall
be and hereby is entirely relieved of all covenants and obligations of
Sublandlord hereunder accruing after the date of such assignment or transfer,
provided such transferee has assumed all covenants and obligations thereafter to
be performed by Sublandlord hereunder. Sublandlord may transfer and deliver any
security of Subtenant to the transferee of the Sublandlord's interest under the
Master Lease, and thereupon Sublandlord shall be discharged from any further
liability with respect thereto.

13. MISCELLANEOUS

        A. Subtenant shall have the right to have signage installed on the
directory sign, if any, provided by Sublandlord for the Building; such signage
shall be at Subtenant's cost, subject to approval by Sublandlord of the details.
Subtenant shall be responsible for maintaining its signage on the directory and
for its removal upon the Expiration Date or earlier termination of this
Sublease.

        B. Sublandlord and Subtenant each represent to the other that they have
dealt with no real estate brokers, finders, agents or salesman. Each party
agrees to hold the other party harmless from and against all claims for
brokerage commissions, finders fees or other compensation made by any other
agent, broker, salesman or finder as a consequence of said party's actions or
dealings with such agent, broker, salesman, or finder.

        C. Sublandlord represents and warrants to Subtenant that, (i) to the
best Sublandlord's knowledge, no default (or condition which will become a
default following the passage of time with or without the giving of notice)
under the Master Lease that would entitle Landlord to terminate the Master Lease
currently exists; (ii) a copy of the Master Lease attached hereto as Exhibit "B"
is true and correct copy of the Master Lease; and (iii) Sublandlord will
cooperate with the Subtenant regarding any relations with Landlord, such as the
giving or receiving of notice or regarding Landlord's rendering of services as
provided under the Master Lease as incorporated in this Sublease.

        D. All prior understandings and agreements between the parties hereto
are merged within this Sublease. This Sublease and the provisions of the Master
Lease incorporated herein by the express terms of this Sublease constitute the
complete and exclusive agreement among the parties with respect to the matters
contained herein and supersede all prior written or oral agreements or
statements by and among the parties hereto, provided that this Sublease shall be
at all times subject to all of the terms and conditions of the Master Lease.

        E. This Sublease may not be changed, amended, modified, or terminated,
either orally or in any manner, other than by express agreement in writing
signed by the parties hereto, and by Landlord to the extent required by the
Master Lease.

        F. Subtenant shall purchase from Sublandlord the furniture in the
Premises owned by Sublandlord listed in Exhibit "D" for the amount of
$75,000.00. Such reimbursement shall be payable by Subtenant to Sublandlord
within thirty (30) days of the date of this Sublease.


                                       11
<PAGE>   12
        IN WITNESS WHEREOF, the parties hereto have caused this instrument to be
executed by hand as of the date first above written.


                                 SUBLANDLORD:

                                 BEA SYSTEMS, INC.,
                                 a Delaware corporation

                                 By:
                                     ---------------------------------------
                                 Its:
                                     ---------------------------------------

                                 SUBTENANT:

                                 WebGain, Inc.
                                 a Delaware corporation

                                 By:
                                     ---------------------------------------
                                 Its:
                                     ---------------------------------------


                                       12