Acoustic waves of GaN nanowires are studied. The materials have a wurtzite structure and thus the elastic anisotropy is included. We use the xyz-algorithm originally employed in the analysis of resonant ultrasound spectroscopy results. We have considered hexagonal cross-section nanowires as those experimentally grown. We have studied also circular cross-section nanowires (nanotubes) for comparison. It was found that the lower frequency modes have a very similar dispersion relation both in shape and frequency value, but higher frequency modes exhibit more important differences. The nanowires are solid or hollow and the influence of the thickness on the dispersion relation and the elastic displacement pattern is considered. Nanowires with a zinc-blende structure have also been considered because of theoretical studies allowing for their existence. We have studied also the squared displacement vectors to see the spatial distribution of the different modes in the nanowires. It was found that there are many modes whose elastic displacement components concentrate around the borders of the nanowire and they do not penetrate almost in the inner part of the nanowire.