In the hybrid energy system of large green ships, different types of energy sources are employed to feed the electricity demand. An optimal energy-management model and control methodology must be developed to obtain operational safety and efficiency. In this study, optimal power-flow dispatching of maritime photovoltaic/battery/diesel/cold-ironing hybrid energy systems is proposed to sufficiently explore solar energy and minimize the ship’s electricity cost. By modelling the constraints (such as power balance, solar output, diesel output, battery capacity, and regulations from the port) as penalty functions, the optimal energy-management is described as an unconstrained, large-scale, global optimization problem, which can be effectively solved by the proposed adaptive multi-context cooperatively coevolving particle swarm optimization algorithm. The proposed approach is verified by simulation for different cases. Results of the simulation show that the optimal energy-management of the evaluated system can be obtained with great electricity cost savings and robust control performance.