Hello Elias,

*First of all, Thank you very much for help. :)*


*After I remove the static from function it worked well. *


*Thanks*

On Thursday, September 12, 2019 at 4:31:05 PM UTC+5:30, Elias Naur wrote:
>
> 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/a6fec9a3-928c-4539-ba95-ac9dd453a7c0%40googlegroups.com.

Reply via email to