mirror of
https://github.com/corda/corda.git
synced 2025-05-02 08:43:15 +00:00
Prevent the node from starting if running on a version of Java with the empty Path bug (#83)
This commit is contained in:
parent
021bcb0628
commit
e34f33785f
@ -34,6 +34,8 @@ fun printBasicNodeInfo(description: String, info: String? = null) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fun main(args: Array<String>) {
|
fun main(args: Array<String>) {
|
||||||
|
checkJavaVersion()
|
||||||
|
|
||||||
val startTime = System.currentTimeMillis()
|
val startTime = System.currentTimeMillis()
|
||||||
|
|
||||||
val parser = OptionParser()
|
val parser = OptionParser()
|
||||||
@ -115,9 +117,24 @@ fun main(args: Array<String>) {
|
|||||||
exitProcess(0)
|
exitProcess(0)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private fun checkJavaVersion() {
|
||||||
|
// Check we're not running a version of Java with a known bug: https://github.com/corda/corda/issues/83
|
||||||
|
try {
|
||||||
|
Paths.get("").normalize()
|
||||||
|
} catch (e: ArrayIndexOutOfBoundsException) {
|
||||||
|
println("""
|
||||||
|
You are using a version of Java that is not supported (${System.getProperty("java.version")}). Please upgrade to the latest version.
|
||||||
|
Corda will now exit...""")
|
||||||
|
exitProcess(1)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private fun printPluginsAndServices(node: Node) {
|
private fun printPluginsAndServices(node: Node) {
|
||||||
node.configuration.extraAdvertisedServiceIds.let { if (it.isNotEmpty()) printBasicNodeInfo("Providing network services", it) }
|
node.configuration.extraAdvertisedServiceIds.let { if (it.isNotEmpty()) printBasicNodeInfo("Providing network services", it) }
|
||||||
val plugins = node.pluginRegistries.map { it.javaClass.name }.filterNot { it.startsWith("net.corda.node.") || it.startsWith("net.corda.core.") }.map { it.substringBefore('$') }
|
val plugins = node.pluginRegistries
|
||||||
|
.map { it.javaClass.name }
|
||||||
|
.filterNot { it.startsWith("net.corda.node.") || it.startsWith("net.corda.core.") }
|
||||||
|
.map { it.substringBefore('$') }
|
||||||
if (plugins.isNotEmpty())
|
if (plugins.isNotEmpty())
|
||||||
printBasicNodeInfo("Loaded plugins", plugins.joinToString())
|
printBasicNodeInfo("Loaded plugins", plugins.joinToString())
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user