Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide an alternative to toolchains.xml #4

Open
mathieucarbou opened this issue Feb 12, 2020 · 2 comments
Open

Provide an alternative to toolchains.xml #4

mathieucarbou opened this issue Feb 12, 2020 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@mathieucarbou
Copy link
Member

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);
    }
  }
@mathieucarbou mathieucarbou added the bug Something isn't working label Feb 12, 2020
@saurabhagas saurabhagas removed their assignment Feb 12, 2020
@saurabhagas
Copy link

Will let this issue be in the backlog, and visit this as time permits.

@aurbroszniowski
Copy link
Member

The main reason why Angela relies on the toolchains file is to solve the following problem:
Angela needs to be able to execute remotely (with ssh) a java process which will handle the remote installation/control of other processes (Terracotta server, test client, etc.)
Therefore, the remote toolchains is read in order to resolve the remote java executable location.

The only option I see currently would be to remotely execute a script to get the JAVA_HOME variable in case the toolchains is not found

@aurbroszniowski aurbroszniowski added enhancement New feature or request and removed bug Something isn't working labels Feb 26, 2020
@saurabhagas saurabhagas changed the title Missing JDK with version [1.8] and one vendor in [[zulu]] config in toolchains.xml Provide an alternative to toolchains.xml Mar 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants