The application development in wireless sensor network (WSN) is complicated due to the diverse software and hardware platforms. One way to solve this problem is to apply the embedded Java virtual machine (EJVM) on the WSN nodes. With the EJVM, the users can program the applications by the popular and high-level abstract Java language. However, several challenges exist for applying the EJVM on the WSN nodes, such as the memory resources on the WSN nodes are constrained, the multitasking programming and real-time response are required by many WSN applications. Currently, these challenges cannot be addressed well by most EJVMs. And in order to address these challenges, a real-time memory-efficient Java operating system HEROS is developed. By means of HEROS, the multitasking real-time Java applications can be developed even on the memory-constrained WSN nodes. Nevertheless, the execution efficiency of the Java bytecode is not high, making the EJVM not suitable to be used on the tight energy-constrained WSN nodes. To solve this problem, a new mid-layer software REMID, which is designed to have some similar functionalities as the EJVM, is also developed. Different from the EJVM, REMID is designed to be both memory efficient and energy efficient, thus it can substitute the EJVM to be used even on the severe energy-constrained WSN nodes. The final evaluation works prove that a user-friendly WSN application development environment can be provided to the users by means of the EJVM, HEROS and REMID.