idea 运行正常打成jar包运行提示“connect: Address is invalid on local machine or port is not valid on remote” ,

解决方法:

 public static void main(String[] args) throws ParseException {

        System.setProperty("java.net.preferIPv4Stack" , "true");
}

在main方法中加入“System.setProperty("java.net.preferIPv4Stack" , "true");”

原因,jdk跑jar默认使用的是ipv6。

相关文章:

  • 2021-12-04
  • 2021-09-30
  • 2022-02-08
  • 2021-09-30
猜你喜欢
  • 2021-04-17
  • 2022-12-23
  • 2022-01-17
  • 2022-12-23
  • 2021-06-01
  • 2021-09-14
相关资源
相似解决方案