On Thu Sep 12, 2019 at 2:35 AM Jay Sharma wrote:
> 
> *Hello Elias,*
> 
> *Following is my java file: *
> 
> 
> package reversebinding;
> 
> public class RBinding {
>  public static String getStringFromJava() {
>         return "Hello from java !!";
>     }
> }
> 
> 
> 

Your Java method is declared as "static"; static methods are exported as
regular functions in reverse bindings. Remove "static" and you might have
better luck calling it.

> 
> *I tried the following in my go file : *
> 
> 
> 
> import "Java/reversebinding/RBinding"
> 
> 
> // creating object like this: 
> 
> javaObj := JavaAPI.New()
> javaObj.GetStringFromJava()
> 
> *But while building using the gomobile it is giving following error: *
> JavaObj.GetStringFromJava undefined (type Java.Reversebinding_JavaAPI has 
> no field or method GetStringFromJava)
> undefined: val
> 
> 

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/BWXZ06VB2ULU.2HUEH0Y162LFV%40toolbox.

Reply via email to