The purpose of this study is to incorporate adaptive ontology into ubiquitous learning grid to achieve seamless learning environment. Ubiquitous learning grid uses ubiquitous computing environment to infer and determine the most adaptive learning contents and procedures in anytime, any place and with any device. To achieve the goal, an ontology-based ubiquitous learning grid (OULG) was proposed to resolve the difficulties concerning how to adapt learning environment for different learners, devices, places. OULG through ontology identifying and adapting in the aspects of domain, task, devices, and background information awareness, so that the adaptive learning content could be delivered. A total of 42 freshmen participate in this study for four months to learn Java programming. Both of pretesting and posttesting are performed to ensure that the OULG is useful. Experimental results demonstrate that OULG is feasibile and effective in facilitating learning.