ISSUE-246 deployNodes doesn't use right version of Java (#5571)

* ISSUE-246 deployNodes doesn't use right version of Java
Ensure the network bootstrapper process is executed using the same version of JAVA as the calling process.

* Apply same fix to NotaryCopier (used in network builder tool).
This commit is contained in:
josecoll 2019-10-09 19:32:17 +01:00 committed by GitHub
parent 515d1088d5
commit 22a8108099
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 2 deletions

View File

@ -33,6 +33,7 @@ import java.io.File
import java.net.URL
import java.nio.file.FileAlreadyExistsException
import java.nio.file.Path
import java.nio.file.Paths
import java.nio.file.StandardCopyOption.REPLACE_EXISTING
import java.security.PublicKey
import java.time.Duration
@ -68,7 +69,7 @@ internal constructor(private val initSerEnv: Boolean,
companion object {
// TODO This will probably need to change once we start using a bundled JVM
private val nodeInfoGenCmd = listOf(
"java",
Paths.get(System.getProperty("java.home"), "bin", "java").toString(),
"-jar",
"corda.jar",
"generate-node-info"

View File

@ -6,6 +6,7 @@ import net.corda.networkbuilder.nodes.FoundNode
import net.corda.networkbuilder.nodes.NodeCopier
import org.slf4j.LoggerFactory
import java.io.File
import java.nio.file.Paths
class NotaryCopier(private val cacheDir: File) : NodeCopier(cacheDir) {
@ -28,7 +29,9 @@ class NotaryCopier(private val cacheDir: File) : NodeCopier(cacheDir) {
fun generateNodeInfo(dirToGenerateFrom: File): File {
val nodeInfoGeneratorProcess = ProcessBuilder()
.command(listOf("java", "-jar", "corda.jar", "generate-node-info"))
.command(listOf(
Paths.get(System.getProperty("java.home"), "bin", "java").toString(),
"-jar", "corda.jar", "generate-node-info"))
.directory(dirToGenerateFrom)
.inheritIO()
.start()