Download the generalized Country borders from here: http://www.baruch.cuny.edu/geoportal/data/esri/esri_intl.htm. These are probably more detailed than you want (Canada has the most vertices at 3316), but is the only free rough border data set I could find online.
To get the coordinates from a shapefile as text, go to MyGeodata Converter
- Run Vector Converter
- Upload the zip file you just downloaded.
- Check available operations
- Export to GeoJSON
- Download Zip file form MyGeodata Converter
- Unzip the file.
Now you have the boundaries in GeoJSON format and can use a GeoJSON parser or a more simple text parser to get the coordinate data.
If that's too much work, you can also parse shapefiles with one of the various Java shapefile frameworks out there. See Does anyone know of a library in Java that can parse ESRI Shapefiles? for some options.