Skip to content

Provide an alternative to toolchains.xml #4

@mathieucarbou

Description

@mathieucarbou

We should find another way to find the JDK. With Gradle, there is no need to have a toolchain.xml file, or even any maven binaries / repo on a computer.

Caused by: java.lang.RuntimeException: Missing JDK with version [1.8] and one vendor in [[zulu]] config in toolchains.xml. Available JDKs: [JDK{home='/Users/mathieu/.jenv/versions/openjdk64-9', version='1.9', vendor='openjdk', valid=false}, JDK{home='/Users/mathieu/.jenv/versions/oracle64-1.8.0.144', version='1.8', vendor='Oracle Corporation', valid=false}, JDK{home='/Users/mathieu/.jenv/versions/zulu64-1.8.0.212', version='1.8', vendor='zulu', valid=false}]
	at org.terracotta.angela.common.util.JavaLocationResolver.resolveJavaLocations(JavaLocationResolver.java:102)
	at org.terracotta.angela.common.util.JavaLocationResolver.resolveJavaLocation(JavaLocationResolver.java:69)
	at org.terracotta.angela.common.distribution.DistributionController.buildEnv(DistributionController.java:68)
	at org.terracotta.angela.common.distribution.Distribution107Controller.createTsa(Distribution107Controller.java:72)
	at org.terracotta.angela.common.TerracottaServerInstance.create(TerracottaServerInstance.java:94)
	at org.terracotta.angela.agent.AgentController.createTsa(AgentController.java:278)
	at org.terracotta.angela.client.Tsa.lambda$create$4baf3c22$1(Tsa.java:227)
	at org.apache.ignite.internal.processors.closure.GridClosureProcessor$C4.execute(GridClosureProcessor.java:1944)
	at org.apache.ignite.internal.processors.job.GridJobWorker$2.call(GridJobWorker.java:568)
	at org.apache.ignite.internal.util.IgniteUtils.wrapThreadLoader(IgniteUtils.java:6820)
	at org.apache.ignite.internal.processors.job.GridJobWorker.execute0(GridJobWorker.java:562)

Perhaps this method could be refactored to take a property file as a config somewhere, which could be optional, and if not provided (i.e. on our local dev computers, then switch back to the default JDK of the computer ?)

  private static List<JDK> findJDKs() {
    try {
      List<JDK> jdks = findJDKs(new File(System.getProperty("user.home") + File.separator + ".m2" + File.separator + "toolchains.xml").toURI().toURL());
      return Collections.unmodifiableList(jdks);
    } catch (MalformedURLException e) {
      throw new RuntimeException(e);
    }
  }

Metadata

Metadata

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions