Prosecutors say Kurtis Cruz, 18, of Merrillville had the gun in a dorm room early Saturday morning.
He's charged with unlawful possession of a weapon.
SEE ALSO: 2nd Amendment backlash follows portrayal of Alex Pretti by some Trump administration officials
Cruz is due back in court next month.
He's being held, pending trial.
"A college campus is supposed to be a safe place for learning and growth, not a place where students and staff alike have to be concerned for their personal safety," DuPage County State's Attorney Robert Berlin said. "The allegation that Mr. Cruz was in possession of a fully loaded weapon with a twenty-six-capacity extended magazine on a college campus is very alarming."