URL url = new URL("http://app.m.360.cn/wsjbb/download.jsp?t=41694&soft_id=41694"); HttpURLConnection hc =(HttpURLConnection)url.openConnection(); hc.setInstanceFollowRedirects(false); System.out.println(hc.getHeaderField("location"));