2017-08-30 40 views
0
为int

看来摇篮披着int值与Integer对象,因此我收到以下错误:如何转换整数摇篮

No signature of method: static org.gradle.plugins.javascript.envjs.http.simple.SimpleHttpFileServerFactory.start() is applicable for argument types: (java.io.File, java.lang.Integer) values: [/Users/lex/Documents/github/proj/build/distributions, 8001] 

我直接使用一个变量,而不是8001尝试,但它也没“T工作:

  • DEF端口= 8001
  • INT端口= 8001

瓦时at是将int值传递给start方法的正确方法?

回答

0

下面的代码为我工作得很好,

SimpleHttpFileServerFactory factory = new SimpleHttpFileServerFactory() 
server = factory.start(new File("..dir..."), (int)port)