Is it possible to know from Java where the computer where it’s running is? If not, how can I do it using JNI? Or any scripts?
I’m building a Java system, and on login, I’m supposed to register on the database who’s logging in, where and when. I just don’t know how to get the where.
Is it possible to know from Java where the computer where it’s running is?
Share
Unless you can get the client to send in some sort of coordinates (like GPS), you could use some IP-based solution, such as MaxMind GeoIP. They have a
liteversions of the city and country locating databases, which are free but less accurate. There are APIs available for most common languages.