SAN JOSE, Calif. — When Harman Ghotra woke up late, dashed out the door and realized he had four minutes to get across campus to deliver a paper to his statistics professor, the calculations started spinning through his mind. Walk to class: Eight minutes. Run? Too much trouble.

Then there it was, parked at the intersection of 4th Street and San Fernando, an electric scooter, the latest craze in urban transportation that is suddenly multiplying around Bay Area downtowns.

“I was running late,” said the 21-year-old computer engineering student, “so why not?”

With a quick click on an app and a flip of the kickstand, he was whizzing across the San Jose State University campus — and arriving with two minutes to spare.

Watch out, Bay Area, the e-scooter revolution is here. In downtowns and near transit stations, the bright green or black electric scooters are zipping down bike lanes and sidewalks, delighting riders, startling pedestrians and catching city officials flat-footed.

And, uh oh, two of them ended up last week in Oakland’s Lake Merritt.

Depending on whom you ask, the rent-on-the-go, motorized scooters are either an accident-waiting-to-happen or the next phase of the new economy’s ingenious attempt at transforming transit as we know it. Just as with the shared bikes that preceded scooters, all you need to do is download the company’s app to find where one may be parked (internal GPS devices keep track of them), “unlock” it and pay for the ride, which costs $1 to get started, then 15 cents a minute.

“It’s wonderful, it adds a whole lot more choices to get around and will help build a great community,” said Shiloh Ballard, executive director of the Silicon Valley Bicycle Coalition.

In the last few of weeks, San Jose has joined Oakland and San Francisco as the latest city to become a scooter and bike-sharing battleground, where startups such as LimeBike (purveyor of the lime-green bikes and scooters) and Bird Rides (with the black e-scooters) are loaded with millions in venture capital money and are racing to market — sometimes with little or no advance warning.

In other words, scoot first, ask permission later.

“They just sort of appeared,” San Jose City Councilman said Raul Peralez of the hundreds of e-scooters that began popping up on street corners and transit malls in the last few weeks. “As with any disruptive technology comes the disruption.”

BART has already cracked down on shared bikes, which are piling up on station platforms and blocking fare gates. Unlike the light blue Ford GoBikes, which are part of a partnership with Bay Area municipalities and transit agencies and require riders to “dock” the bikes at specified racks, the newer vehicles are “dockless” and enable riders to discard bikes and scooters just about anywhere.

The companies redistribute bikes and scooters throughout the day so they don’t end up in one place. Batteries are swapped for recharging.

In China and Europe, where more than 30 startups have flooded the markets and shared bikes are ubiquitous, photos of tangled piles of bikes on sidewalks or at the bottom of canals are easy to find online. San Mateo-based LimeBike, for one, says that it has lost about 1 percent of its fleet to mischief in the 60 cities and universities across the U.S. it is operating.

But across the Bay Area, cities are fielding complaints from business owners who say the scooters are blocking doorways and sidewalks. Since the smart scooters are considered mechanized vehicles, they are banned from sidewalks and helmets are required by law. But nearly everyone is ignoring both rules.

“We need to educate our community to think, ‘Hey we’re on a motorized scooter,’ ” said Ginger Jui of Bike East Bay, who’s seen more scooters on the Lakeshore Avenue sidewalks around Lake Merritt than on the designated bike path. “This is your role and responsibility not to ride on the sidewalk.”

In San Jose, Lindy Stankov and Jaime Avalos, who both work in downtown San Jose, have been dodging the scooters since they were introduced at the end of March.

“We’re nervous,” said Stankov, 57, who works at City Hall. “It’s just dangerous.”

City leaders, meanwhile, are conflicted between trying to be receptive to the latest carbon-neutral innovation and keeping the streets safe for pedestrians — and they’re scrambling to get permits and rules in place before anyone gets hurt.

“It’s new technology. It’s companies competing for the most ridership, and at the moment we don’t have a regulatory framework around it,” said Colin Heyne, public information manager for San Jose’s Department of Transportation.

Bird — founded by former Lyft and Uber exec Travis VanderZanden — got off to a rocky start when it launched in Santa Monica in September and was charged with a misdemeanor by December for failing to secure proper permits and ignoring citations to remove its scooters from sidewalks. It settled with the city for $300,000 by February. One scooter rider there was injured in a collision with a car.

When Bird launched in San Jose a couple of weeks ago, “they told us the day they dropped them off,” Heyne said.

To smooth things over, Bird officials announced a revenue sharing plan with cities, offering to give $1 per scooter per day to help pay for new bike lanes, safety messaging and shared infrastructure maintenance.

At the end of March, the city of San Francisco accused LimeBikes of “bad faith” for launching its service before the city had its permitting plan in place, even after indicating it would wait. LimeBike countered that it was a “limited pop-up program” and promised to share data on ridership to improve overall transportation planning.

Soon, Bay Area cities will see more than just the lime green and black scooters. More startups are coming. Ofo, with its bright yellow and black bikes, says it is already working with the city of San Jose. JUMP e-bikes are in San Francisco.

Dave Snyder, executive director of the California Bicycle Coalition, says cities still have a long way to go to reduce Californians’ reliance on cars. But shared bikes and scooters are a good addition, despite the early problems.

“They’re in a struggle for market share right now,” he said. “They can’t all survive.”