We study the optimal licensing means by considering the financial structure of firms and limited liability. We show the optimal licensing contract can be either royalty or fixed-fee licensing. We justify the superiority of royalty licensing by an endogenous way of varying the intensity of competition. Increasing mean-preserving variance of demand always results in bigger debt levels. Enhancing innovation size increases debt levels in non-exclusive fixed-fee licensing. Enhancing innovation size has no impact on debt levels in royalty licensing.