The jobs figures for May disappointed most analysts. But Mark Zuckerberg and Bill Gates, who built billion-dollar technology companies in two very different areas, see more seismic shifts ahead.

At his recent Harvard University commencement speech, Facebook’s FB, +2.12% chief executive Zuckerberg had some tough words for the Class of 2017. “Our generation will have to deal with tens of millions of jobs replaced by automation like self-driving cars and trucks,” he said, adding, “When our parents graduated, purpose reliably came from your job, your church, your community. But today, technology and automation are eliminating many jobs. Membership in communities is declining. Many people feel disconnected and depressed, and are trying to fill a void.”

Gates, the founder of Microsoft MSFT, +2.27% last month, sounded the same warning. Gates said he didn’t want to sound like the guy from “The Graduate,” which celebrates 50 years this year. In that movie, old Benjamin Braddock (Dustin Hoffman) was given this very famous piece of advice: “I just want to say one word to you. Just one word …Plastics,” And today? That word would likely be “robots.” Gates took his 34.8 million Twitter followers by the virtual shoulder and said “artificial intelligence” would have a huge impact. In other words, why not join the revolution? After all, that’s exactly what Zuckerberg and Gates did with social media and computer software.

When it comes to retirement, 60s are the new 50s

But that’s not the only response to the robot revolution. Last February, Gates also told Quartz that robots should free up labor “and give graduates an opportunity to focus on jobs that only let us do a better job of reaching out to the elderly, having smaller class sizes, helping kids with special needs. You know, all of those are things where human empathy and understanding are still very, very unique.” Gates said there is a counter-intuitive way of approaching the rise of robots. “So if you can take the labor that used to do the thing automation replaces ...then you’re net ahead.”

Zuckerberg too spoke about finding meaningful jobs and purpose in this new automated economy. “Class of 2017, you are graduating into a world that needs purpose. It’s up to you to create it,” he said, adding, “Taking on big meaningful projects is the first thing we can do to create a world where everyone has a sense of purpose. The second is redefining equality to give everyone the freedom they need to pursue purpose. Many of our parents had stable jobs throughout their careers.” Today’s graduates, he said, will need to carve their own path, but have the freedom to fail and to try again.

They’re not wrong: Robots are expected to create 15 million new jobs in the U.S. over the next 10 years, as a direct result of automation and artificial intelligence, equivalent to 10% of the workforce, a recent report by Forrester Research found. The downside: robotics will also kill 25 million jobs over the same period. So in one way Gates is correct. Artificial intelligence and automation is an area undergoing a seismic shift, just like computers did in the 1980s and plastics did 30 years before that, and how people around the world changed how the communicate and share information about themselves (and, yes, data about themselves) 10 years ago.

And what field will be hot 50 years from now? Some 65% of Americans expect that within 50 years robots and computers will “definitely” or “probably” do much of the work currently done by humans, according to a survey by the Pew Research Center, a nonprofit think tank in Washington, D.C. Some 38% of jobs in the U.S. are at “high risk” of being replaced by robots and artificial intelligence over the next 15 years, a separate estimate by consulting and accounting firm PwC found, which is still lower than Germany (35%) and the U.K. (30%).

Don’t miss: Where new graduates can do the impossible: Find a home and a well-paid job

But for those who don’t want to work in artificial intelligence, there are some “robot-proof” careers, at least for now. They include composers and artists, nurse practitioners, home health aides, elder care specialists, child care workers, engineers, teachers and, finally, human resources executives, a report released earlier this month by careers firm Challenger, Gray & Christmas concluded. What’s more, many traditionally blue-collar jobs will be hard to replace, including carpenters, plumbers, electricians. And, of course, robot engineers will not be replaced by robots.

Low-paying jobs appear most at risk from robots, economists predict. For those who want to avoid being replaced by robots, a college education will likely help. As MarketWatch previously reported, there’s an 83% chance that automation will replace a job that pays $20 per hour, according to a White House report released last year. It found that there’s only a 31% chance that robots will take over a job that pays between $30 and $40 per hour, and only a 4% chance that automation will replace jobs with an hourly wage over $40.

Also see:This is how much S&P 500 CEOs received in pay hikes last year

Gates also cited biosciences and energy as a good bet for the Class of 2017. Traditional energy and energy efficiency sectors employ around 6.4 million Americans, according to the 2017 U.S. Energy and Employment Report. These sectors increased in 2016 by around 5% on the previous year and account for roughly 14% of all those created in the country. Jobs in biosciences are increasing at a rate of 10% per year, the latest report on the industry by the Biotechnology Innovation Organization estimated, and employs nearly 1.7 million people in the U.S.

And Zuckerberg also had some words of wisdom for tomorrow’s entrepreneurs. “Let me tell you a secret: no one does when they begin. Ideas don’t come out fully formed. They only become clear as you work on them. You just have to get started,” he said. “If I had to understand everything about connecting people before I began, I never would have started Facebook. Movies and pop culture get this all wrong. The idea of a single eureka moment is a dangerous lie. It makes us feel inadequate since we haven’t had ours. It prevents people with seeds of good ideas from getting started.”

(This story was republished on July 7.)