An efficient one-pot dehydration process for convert D-glucosamine hydrochloride (GlcNH2) into 2-(D-arabino-1′,2′,3′,4′-tetrahydroxybutyl)-5-(D-erythro-2′′,3′′,4′′-trihydroxybutyl)pyrazine (deoxyfructosazine, DOF) and 2,5-bis-(D-arabino-1,2,3,4-tetrahydroxybutyl)pyrazine (fructosazine, FZ) was reported. A task-specific basic ionic liquid, 1-butyl-3-methylimidazolium hydroxide ([BMIM]OH), was employed as an environmentally-friendly solvent and catalyst. The products were qualitatively and quantitatively characterized by MALDI-TOF-MS, 1H NMR and 13C NMR spectroscopy. The influences of GlcNH2 concentrations, reaction temperature, reaction time, additives and co-solvents on the yields of products were studied. The maximum yield of 49% was obtained in the presence of [BMIM]OH and DMSO under optimized conditions (120 °C, 180 min). In addition, a plausible mechanism was proposed. Our project was to develop efficient, atom economical and eco-compatible routes for the synthesis of heterocyclic compounds from marine biomass (or nitrogen-containing biomass). The obtained aromatic heterocyclic compounds showed potential pharmacological action and physiological effects, and they also could be utilized as flavoring agents in the food industry.