Students are frequently exhorted to study programming and computer science to find a high-paying job, but it turns out that the most in-demand careers might be elsewhere.

The U.S. is facing a pending labor shortage in the next two decades, but the occupations that will need workers the most aren't many so-called STEM subjects (science, technology, engineering and mathematics), according to a new study from the corporate-research organization the Conference Board. That's partly due to demographics, while the nature of tech jobs is also to blame, given that they're easy to outsource to other countries.

While it may be hard to believe that the country is facing a labor shortage given the difficulty many workers are still facing in finding work, demographic shifts over the next several years will tip the scales. Millions of Baby Boomers are retiring each year, and while millennial generation is slightly larger than the Boomer group, they've largely already entered the labor market. The next age group, Generation Z, is smaller than the millennials.

Get Breaking News Delivered to Your Inbox

"When it's a tight labor market, all workers benefit to some degree," said Gad Levanon, the chief economist, North America, for the Conference Board. Wages, for instance, tend to rise, and discouraged workers are more likely to reenter the labor market.

Because of the demographic shifts, the native population of the U.S. will be virtually unchanged over the next 15 years, the report noted. At the same time, employers will be looking to fill more jobs than there are workers, although not every profession will face labor shortages.

The industries facing the most dire shortages include the health-care industry -- thanks to the aging U.S. population -- and skilled trade labor. The good news for American workers is that some jobs in these industries don't require a bachelor's degree, although many require post-high school training and licensing, such as electricians.

Given that two-thirds of American workers lack college degrees, the shift within the labor markets may provide some hope to those workers. Yet Levanon noted that some young Americans aren't interested in those fields, partly because the status of earning a college degree has risen.

The pending shortage in skilled labor roles "is an opportunity certainly," he said. "There are relatively few young people who want to enter those jobs. There is some stigma associated with it."

Many young Americans hold the belief "if you want to make it in the U.S., you have to have a college degree," he added.

So what's happening with computer-related jobs? Many STEM professions are already drawing a lot of young professionals, while there are projected to be fewer retirements given that computer-related jobs weren't major industries for Baby Boomers. Those businesses that do face shortages, though, will likely be able to plug the hole with teleworkers, outsourcing outside the U.S. or hiring through visa-worker programs.

Health-care related jobs will be in strong demand thanks to the aging U.S. population, the report found. The occupation with the largest likelihood of a labor crunch is occupational therapy and physical therapist aides, for instance.

There are already some signs of a shift within the labor market, Levanon noted. The time required to fill a job is already at pre-recession rates and has reached its highest point in at least 16 years. During the recession, many employers used "opportunistic upskilling" -- or raising their education and experience requirements. But finding that level of worker now has become more difficult as the labor market tightens.

Employers "got away with it because everyone needed a job," he said. "But as the labor market gets tighter, it's harder to fill the positions with that level of qualifications."

Asked what advice he'd give to a student today about career choice, Levanon said young people "should dream."

"In your career you should do what you enjoy and what you are good at, and that's the No. 1 criteria," he said. "But if you are interested in both being a doctor and being a lawyer, given the labor market conditions, being a doctor is a little more promising than being a lawyer."

Below are 10 professions facing the largest percentage risk of labor shortages:

1. Occupational therapy and physical therapist aides (100 percent)

2. Mathematical science occupations (98.9 percent)

3. Health diagnosing and treating practitioners (97.8 percent)

4. Plant and system operators (95.7 percent)

5. Rail transportation workers (93.6 percent)

6. Machinists (89.9 percent)

7. Water transportation workers (85.1 percent)

8. Financial specialists (84 percent)

9. Electricians (80.2 percent)

10. Lawyers, judges and related workers (78.7 percent)