Castle & Cooke Inc. is long on bananas and short on cash.

The Honolulu-based company, best known for its Dole products, has lost about $126 million in the last two years, and its struggling banana business is symptomatic of its current difficulties. With the worldwide banana industry plagued by oversupply and depressed prices last year, Castle & Cooke at times lost $2 on every box of bananas it owned and could not sell, and $1 on every box it sold, according to one industry analyst.

In the first quarter of fiscal 1985, the company lost $12.2 million. In the second quarter, after it became clear that its bank loans would have to be rescheduled to avoid bankruptcy, C&C rescinded $2.3 million in previously declared preferred dividends, which prompted a suit by a shareholder group.

And now, as C&C raises cash by selling some assets, including its Bumblebee Tuna subsidiary, and negotiates with a group of banks to reschedule more than $100 million in loans, the company also is trying to prevent Minneapolis investor Irwin L. Jacobs from acquiring additional C&C stock. A Jacobs-led investor group recently purchased 12 percent of C&C and disclosed last week that it might attempt to take control of the cash-strapped food products and real estate company.

The Jacobs group said it might try to promote a takeover through a "third party." Charging that the investor group violated state laws, C&C obtained an order in a Hawaii state court that prevents the group from buying more stock until a hearing Monday, a move that Jacobs says is a delaying tactic.

With a depressed stock price that doesn't fully reflect the company's valuable real estate in California and Hawaii, C&C is an inviting takeover target. Early last year, Houston investor Charles Hurwitz purchased about 12 percent of the company, threatened to buy more, and then sold his stock to C&C for more than $70 million, pocketing an estimated $15 million in profits and leaving C&C short of cash.

Jacobs indicated he would not follow Hurwitz by selling his stock back to the company, and experts said they believe him. They point out that C&C has neither the cash nor the credit to purchase Jacobs' stock to remain independent.

A Bethesda-based investment manager, Torray Clark & Co., owned about 20 percent of C&C as of Dec. 31, but may have changed its position earlier this month. The Bass Brothers of Fort Worth, Tex., reportedly owned preferred stock in C&C that is convertible into about 1 percent of C&C common stock.

The company's problems are not easily solved, as the banana glut demonstrates. It would seem logical that if the business is unprofitable, C&C should stop growing and buying so many bananas in some Central American countries. However, the company agreed to purchase large quantities of bananas at fixed prices in countries where there is pressure on C&C to honor these agreements.

For example, C&C owns a profitable Coca-Cola bottling franchise and a profitable brewery in Honduras, a nation that could make life more difficult for C&C if it does not continue to buy bananas at the previously agreed upon terms.

"Murphy's Law has run amok at Castle & Cooke," said Bill Gibson, vice president of research at Davis Skaggs Research, a division of Shearson Lehman/American Express. "This is a company that has no breathing room, and bananas have been the killer.

"Chapter 11 could be the next step, but I don't think it will be, because they have assets they can sell to raise cash," Gibson added.

Gibson says he believes the company's real estate is worth between $190 million and $350 million, adding that he arrived at that figure by assigning a $50 million-to-$75 million price to the Hawaiian island of Lanai, which the company owns. However, the real estate could be worth substantially more if the island, used now to grow pineapple, could be developed, Gibson said. Castle & Cook has a weak balance sheet that recently showed long-term debt of $360 million and equity of only about $25 million, according to Gibson, but the firm's real estate subsidiary, Oceanic Properties Inc., performed well last year, contributing $9 million to net income. It is possible that the Jacobs group is attracted to C&C because of its real estate subsidiary and would arrange for a food company, such as General Foods Corp., to take over the produce and other food businesses. C&C is the nation's largest producer of fresh fruits and vegetables.

The company wants to reduce its long-term debt by selling assets. C&C also wants to transform its image from a commodity company into a consumer-oriented firm with high brand-name recognition. But in recent years, a diversification program aimed at producing more balanced earnings failed as the company journeyed into and out of industries, such as pool sweeping and propellers, that it knew little about.

"We will have a plan in our bankers' hands by Feb. 1 that should give them confidence in the company," C&C Vice President Ted Marks said. "We are cutting the advertising, promotion and new product introductions spending level. Our operating losses have been disappointing to everybody. . . . "