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

bal tool is not working when java is not installed #6473

Closed
anupama-pathirage opened this issue Apr 30, 2024 · 4 comments · Fixed by ballerina-platform/edi-tools#46
Closed
Assignees
Labels
module/edi Issues related to Ballerina EDI module Reason/MultipleComponentInteraction Issue occured due to interactions in multiple components. Type/Bug

Comments

@anupama-pathirage
Copy link
Contributor

Description:

Getting the following error when trying to execute the bal edi command.

Note : Java is not installed in this machine.

bal edi codegen -i resources/schema.json -o modules/orders/records.bal
Generating code for resources/schema.json...
The operation couldn’t be completed. Unable to locate a Java Runtime.
Please visit http://www.java.com for information on installing Java

Observed the error in both 8.5 and 9.0 RC as well.

More details if needed.

image
@niveathika
Copy link
Contributor

We are able to reproduce this issue.

To give more context, edi-tool is designed such that the logic can be kept in a ballerina package. The tool runs the compiled jar when invoked. This is the reason for java dependency. To keep the design and remove the dependency, I am looking into if we can pack the bala and run that using Project APIs when the tool is invoked.

If the above solution does not work out, we are left with only following options,

  1. Report the java dependency in docs so the user does not come into the issue
  2. Migrate the logic from ballerina to java. This will be a huge effort.

@niveathika
Copy link
Contributor

For now I am proposing a workaround by having the user install ballerina instead of java.

ballerina-platform/edi-tools#45

This still needs to be evaluated at architecture level to see if there are different efficient solutions.

@niveathika
Copy link
Contributor

We have decided to go with using bal run instead of java -jar to execute the jar. This is a temporary measure till the CLI tool interface is revamped as mentioned in ballerina-platform/ballerina-lang#42729 (comment)

@niveathika
Copy link
Contributor

The PR will remove the java dependency. However, the fix requires that ballerina is installed in the machine. This will be fixed in U10 and will be tracked in #6575

@niveathika niveathika added the Reason/MultipleComponentInteraction Issue occured due to interactions in multiple components. label May 29, 2024
@ballerina-platform ballerina-platform deleted a comment from github-actions bot May 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
module/edi Issues related to Ballerina EDI module Reason/MultipleComponentInteraction Issue occured due to interactions in multiple components. Type/Bug
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants