我想从命令行将我的eclipse项目导出为JAR,但只通过带有File的Eclipse UI完成此操作 - >出口 - > Java - > JAR。
答案 0 :(得分:2)
Java JDK提供// Get content of json url
let jsonString = try NSString.init(contentsOfURL: url!, encoding: NSUTF8StringEncoding)
// Create JSON Dictionary from data
var jsonResult = NSJSONSerialization.JSONObjectWithData(jsonString.dataUsingEncoding(NSUTF8StringEncoding, allowLossyConversion: false)!, options: NSJSONReadingOptions.MutableContainers, error: &err) as NSDictionary
//Create instance for base model representation
let responseModel = Json4Swift_Base(dictionary: jsonResult)
//print name
print(responseModel!.name)
//Get the collection2 from result
let collection2 = responseModel?.results!.collection2
//Get the first object from collection 2
let firstObject = collection2?.first
//Print the event and hesta
print(firstObject?.event?.text)
print(firstObject?.hasta)
命令:https://docs.oracle.com/javase/8/docs/technotes/tools/unix/jar.html
对于更精细的用途,建议您考虑使用Apache Ant或Maven: