AIZU-WAKAMATSU, Japan—Haruyasu Miyabe used to oversee a computer-chip production line at a Fujitsu Ltd. plant here. One day last year, the plant manager told Mr. Miyabe to prepare for a career change.

"Starting tomorrow, you are going to make lettuce," he recalls being told.

Amid troubled times in the Japanese electronics industry,...