This paper considers the navigation of a solar-powered unmanned aerial vehicle (UAV) for securing the communication with an intended ground node in the presence of eavesdroppers in urban environments. To complete this task, the UAV needs to not only fly safely in the complex urban environment, but also take into account the communication performance with the intended node and eavesdroppers. To this end, we formulate a multi-objective optimization problem to plan the UAV path. This problem jointly considers the maximization of the residual energy of the solar-powered UAV at the end of the mission, the maximization of the time period in which the UAV can securely communicate with the intended node and the minimization of the time to reach the destination. We pay attention to the impact of the buildings in the urban environments, which may block the transmitted signals and also create some shadow region where the UAV cannot harvest energy. A Rapidly-exploring Random Tree (RRT) based path planning scheme is presented. This scheme captures the nonlinear UAV motion model, and is computationally efficient considering the randomness nature. From the generated tree, a set of possible paths can be found. We evaluate the security of the wireless communication, compute the overall energy consumption as well as the harvested amount for each path and calculate the time to complete the flight. Compared to a general RRT scheme, the proposed method enables a large time window for the UAV to securely transmit data.