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

bindings java: HelloElektra.java errors #2537

Closed
dmoisej opened this issue Mar 26, 2019 · 3 comments
Closed

bindings java: HelloElektra.java errors #2537

dmoisej opened this issue Mar 26, 2019 · 3 comments
Assignees
Labels

Comments

@dmoisej
Copy link
Contributor

dmoisej commented Mar 26, 2019

The problem is related to the guide: https://www.libelektra.org/bindings/jna

Firstly, I cloned the Elektra source code from git and has compiled it, so I've got my build folder. Secondly, I followed a guide under https://www.libelektra.org/bindings/jna just to test the binding.

As a result, IntellijIDEA has thrown me a few errors. The error appears on the lines 8, 12 and 38.

final Key key = Key.create("user/hello_world", Key.KEY_VALUE, "Hello World", Key.KEY_END);

final KeySet ks = KeySet.create(10, Key.create("user/hello_world2", Key.KEY_VALUE, "Hello World2", Key.KEY_END), key, KeySet.KS_END);

final Key b = Key.create("user/boolean", Key.KEY_VALUE, "true", Key.KEY_END);

The IntellijIDEA reported me, that it cannot resolve the method create on each of the lines, that I specified.

I spent some time to understand if I have done something wrong while following the guide. Eventually I looked into the class implementation and saw, that the arguments of those lines don't match any create method. After some little workaround, I have managed to fix the problem, so I believe, that the parameters, which are sent in the HelloElektra.java must be changed.

Please correct me, if I am wrong. Also could this issue be considered as a home work? If yes, please assign me to it, so I can add it to my list of issues.

@dmoisej dmoisej changed the title bindings java: HelloElektra.java errors and guide mistakes bindings java: HelloElektra.java errors Mar 26, 2019
@markus2330 markus2330 added the bug label Mar 26, 2019
@markus2330
Copy link
Contributor

markus2330 commented Mar 26, 2019

Thank you for this issue!

I spent some time to understand if I have done something wrong while following the guide.

You should not assume that you did something wrong. Maybe the guide simply does not cover your installation/Java setup/... Or maybe there is even something wrong in the guide or the code (In this case it seems like the problem is in the code, see below).

I have managed to fix the problem, so I believe, that the parameters, which are sent in the HelloElektra.java must be changed.

Yes. The create method was improved in 9643232 (to make them more safe). But it seems like the "HelloElektra.java" was not updated. Please do that in a PR. A longer HelloElektra.java with more comments is highly appreciated.

@dmoisej
Copy link
Contributor Author

dmoisej commented Mar 27, 2019

The Pull Request is created:
#2542

@markus2330
Copy link
Contributor

Seems to be fixed now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants