(Story courtesy ofThe Wall Street Journal) U.S. manufacturing companies, long known for layoffs and shipping jobs overseas, now find themselves in a very different position: scrambling for scarce talent at home.

Large and small manufacturers of everything from machine tools to chemicals are scouring for potential hires in high schools, community colleges and the military. They are poaching from one another, retraining people who used to have white-collar jobs, and in some cases even hiring former prisoners who learned machinist skills behind bars.

Even with unemployment near 9%, manufacturers are struggling to find enough skilled workers because of a confluence of three trends.

First, after falling for more than a decade, the number of U.S. manufacturing jobs is growing modestly, with manufacturers adding 25,000 workers in April, the seventh straight month of gains, according to payroll firm Automatic Data Processing Inc. and consultancy Macroeconomic Advisers. The Labor Department’s jobs report on Friday is expected to show moderate employment growth in the overall economy.

Second, baby-boomer retirements are starting to sap factories of their most experienced workers. An estimated 2.7 million U.S. manufacturing employees, or nearly a quarter of the total, are 55 or older.

Third, the U.S. education system isn’t turning out enough people with the math and science skills needed to operate and repair sophisticated computer-controlled factory equipment, jobs that often pay $50,000 to $80,000 a year, plus benefits. Manufacturers say parents and guidance counselors discourage bright kids from even considering careers in manufacturing.

"We get people coming in here all the time who say, ’I can weld,’" says Denis Gimbel, human-resources manager at Lehigh Heavy Forge Corp., of Bethlehem, PA., whose products include parts for ships. "Well, my grandmother could weld." He needs people who understand the intricacies of $1 million lathes and other metal-shaping equipment.

Manufacturers have anticipated for years that baby-boomer retirements would create difficulties. Among those who have tried to get ahead of the demographic curve-with mixed success-is Jeff Kelly, chief executive of Hamill Manufacturing Co., a family-owned company near Pittsburgh that cuts metal into parts for ships and machinery.

Hamill doesn’t have any button-pushing work. The 127-employee company is constantly resetting its mills and lathes to produce small numbers of parts to meet precise and ever-changing specifications. There are no long, routine production runs.

One morning in late April, Trent Thompson, a 20-year-old Hamill apprentice wearing shredded jeans and a black baseball cap, was assigned to drill three holes in a piece of carbon steel about the size and shape of a hockey puck. To make sure he was spacing the holes exactly right, he scrawled a triangle and some trigonometric calculations on a notepad. Even a tiny error would mean wasting about $400 of metal.

In another corner of the factory, Bill Schaltenbrand, 59, was cutting bigger, more complicated parts. A computer had worked out where he should drill and cut, but Mr. Schaltenbrand, a 40-year veteran at Hamill, does his own math to double-check the plans. Computers, he says, sometimes "punch out stupid stuff." Part of Mr. Schaltenbrand’s skill is reading blueprints with myriad numbers and symbols that would baffle most people.

In its search for talent, Hamill works with nearby vocational schools-serving on advisory boards, donating equipment and providing guest lecturers. Mr. Kelly helps organize a program called BotsIQ, in which high-school students learn to build fighting robots. On a recent Saturday evening, he handed out trophies after a robot dubbed Grim Reaper 3, resembling a bathroom scale with spinning metal blades, flipped a rival called Black Mamba and left it in a smoking heap.

Through its ties to area high schools, Hamill met Walter Gasper about five years ago. Mr. Gasper, whose father is a mechanic, had good grades in high school and took college-prep courses. He says a counselor tried to discourage him from vocational courses, but he took them anyway because he liked working with machinery. Hamill signed him as an apprentice when he was 17 and let him work part time while finishing high school.

Last June, Mr. Kelly beamed as he posed for a picture with Mr. Gasper and the first-prize trophy he won in a national competition in which apprentices displayed metal-working skills.

Three months later, Mr. Gasper bolted for a new job with a Cheswick, PA., unit of Curtiss-Wright Corp., a much larger maker of pumps and generators that buys parts from Hamill. Curtiss-Wright offered him about 40% more pay than he was getting at Hamill. "I was just looking to further my career a little," says Mr. Gasper, now 21. Though he has no college degree, his annual pay tops $55,000. Unlike many young adults, he has no college debt.

Hamill’s Mr. Kelly says he has raised wages 18% to 25% over the past two years or so, but still has lost about 10 workers in that period to Curtiss-Wright.

Greg Hempfling, a senior vice president at Curtiss-Wright, says he isn’t poaching but merely posting job offers. The pool of skilled manufacturing labor has been "decimated" in the Pittsburgh area, he says, and that has forced Curtiss-Wright to advertise for help as far away as Detroit and Buffalo, NY.

Even some global giants are stretched to find enough qualified workers. At a U.S. division of Bayer AG that makes plastics and polyurethane, the average age of employees is about 52, says Gregory Babe, chief executive of the German company’s U.S. business. The skill shortage "is a real issue, and it’s going to get much worse," he says.

Bayer has had particular trouble filling positions in such areas as chemical-process technology at its plastics plant in Baytown, Texas, near Houston. A decade ago, Mr. Babe says, a job opening typically would attract 100 applications. "These days I get about 10," he says. After screening, Bayer often finds that only a couple are qualified. Some jobs have been open six to nine months.

"This place is five acres, and it’s three stories tall," says Donny Simon, 55, who has worked in the plant since 1988. It takes time to understand how all the pipes, valves, pumps and feedstock tanks work together and how to avoid explosions or other accidents. Technicians need basic math and science for such tasks as calculating the rate at which dyes and stabilizing agents need to be added for specially ordered batches of plastics.

Because it can’t find enough candidates with relevant experience, Bayer this summer will for the first time hire interns to learn how to operate machinery at the Baytown plant. It plans to offer $18 to $23 an hour-unusually good pay for summer jobs-and to choose among students in "process technology" at local community colleges. Those who do well are likely to be offered permanent jobs.

Manufacturers are having trouble now partly because some of them stinted on recruitment and training when it was easier to find workers. Woodward Inc., a maker of parts for aircraft and power-generation equipment based in Fort Collins, Colo., for decades operated its own academy to train workers, but it closed it during a late-1990s cost-cutting drive. As a result, says Keith Korasick, who supervises manufacturing at Woodward’s Fort Collins plant, "we kind of lost our pipeline of skilled machinists and technicians."

Now Woodward is sponsoring two dozen students at community colleges in Fort Collins and Rockford, Ill., the company’s other big U.S. manufacturing site. It pays their tuition and other costs for two-year programs in manufacturing skills. The students also are paid for 20 hours or so of work per week. To stay in the program, they need to maintain a grade-point average of at least 3.0.

Once the students finish those two-year degrees, Woodward aims to hire them for full-time manufacturing jobs starting at $25,000 to $48,000 a year.

As a high-school student in Fort Collins, Zach Wagner met Mr. Korasick and other guest lecturers from Woodward. Mr. Wagner, now 18, says he was interested in "computer stuff" and hadn’t thought much about manufacturing. Most of his friends were heading for four-year universities. He considered doing the same, but he worried about running up debts. So he accepted a community-college scholarship from Woodward. He aims eventually to get a degree in engineering while working at Woodward.

Manufacturers say the U.S. education system doesn’t produce enough students strong in math, science and engineering. About 5% of bachelor’s degrees awarded in the United States are in engineering, compared with an average of about 20% in Asia, according to the U.S. National Science Foundation. In the most recent comparison of math and science test scores of 15-year-old students by the Organization for Economic Cooperation and Development, American students trailed far behind those from China, Japan, South Korea, Canada and Germany.

While community colleges and technical schools struggle to keep up with demand for skilled workers, some prisons are trying to help. At California’s San Quentin prison, the machine shop offers training to prepare prisoners to pass exams demonstrating skills in such areas as operating computer-controlled lathes and mills. Some inmates get classes in calculus and trigonometry to help them work with machinery.

Swift-Cor Aerospace, a maker of airplane parts, has hired several former prisoners for its plants near Los Angeles and Wichita, Kan., and is happy with their work, says Cecilia Mauricio, human-resources manager.

The impending retirement of boomers isn’t a problem for everyone. Advanced Technology Services Inc. of Peoria, Ill., sees the trend as a huge opportunity. ATS provides maintenance and related services for manufacturers. Jeff Owens, president of the company, says he expects demand for those services to surge as manufacturers can’t find enough qualified employees and need to outsource more tasks to firms like ATS.

ATS now has about 2,400 employees in the United States and aims to reach 2,800 by year-end. Nearly a third of the people ATS hires come from military backgrounds, often with experience in fixing tanks or airplanes. Aside from knowing how to fix machines, the military vets are good at "being on time, being clean-cut," Mr. Owens says.

ATS also helps pay for 40-week community-college training programs for some people it hopes to hire, and it funds scholarships for engineering students at universities. Two ATS managers spend nearly full time working with high schools, attending career days, conducting plant tours and meeting with guidance counselors.

"They’re out there selling the idea of working in a manufacturing plant-and trying to dispel the notion that it’s dark and dirty and unsafe and boring," Mr. Owens says.

Henry Welsch, 36, is one of ATS’s converts. For the first 15 years of his adult life, he worked as an insurance agent and claims adjustor and as a sales manager for a moving company. But he decided a couple of years ago that he would rather have a job that was more secure and provided steady pay rather than unpredictable commission income.

One problem: He had never worked with tools or machinery. "I was starting from just nothing," he says. He signed up for a nine-month manufacturing-skills course at Illinois Central College in East Peoria, Ill., and got a job at ATS in late 2009. That company assigned him to a Caterpillar Inc. plant, where he repairs machinery.

It was a rough transition. He had to prove himself to his new colleagues, some of whom, he says, were "a little rough around the edges." The job may lack glamor, Mr. Welsch says, but he thinks he made the right choice. "This is what I do in the daytime, and I go home and don’t have to think about it."