You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@thrift.apache.org by Keerthi N <ke...@gmail.com> on 2019/01/29 19:45:51 UTC

Thrift Java Client in Windows

Hello,

I'm trying to execute Java server and client for thrift. I'm currently
using windows  so I downloaded thrift.exe file from thrifit offical website
and I'm able to successfully gen java code.

I have written desired Java server and client code in visual studio code
and tried 3 options here separately : added java libraries from
thrift/lib/java ,  downloaded explicit jar file in the same folder as the
server/client code is in, downloaded maven and created maven archetype
thrift plugin, with pom.xml file having all required dependencies, Java
Server, client and thrift generated files.

In all these options my IDE wasn't able to recognize or in other
words throwing error import org.apache.thrift / different classes such as
TTransport does not exist/can not be found.

Please let me know any possible solutions.

Thanks,
Keerthi

Re: Thrift Java Client in Windows

Posted by Keerthi N <ke...@gmail.com>.
Thank you so much. That's helpful.

-Keerthi

On Tue, Jan 29, 2019 at 6:03 PM James E. King III <jk...@apache.org> wrote:

> If you use gradle to build your project you could add this to make it pull
> in the most recent version:
>
> from:
> https://mvnrepository.com/artifact/org.apache.thrift/libthrift/0.12.0
> (gradle tab):
>
> compile group: 'org.apache.thrift', name: 'libthrift', version: '0.12.0'
>
> or if you want to use ant and maven:
>
> <!-- https://mvnrepository.com/artifact/org.apache.thrift/libthrift -->
> <dependency>
>     <groupId>org.apache.thrift</groupId>
>     <artifactId>libthrift</artifactId>
>     <version>0.12.0</version>
> </dependency>
>
> You shouldn't have to download anything manually.
>
> - Jim
>
> On Tue, Jan 29, 2019 at 4:28 PM Randy Abernethy <ra...@rx-m.com>
> wrote:
>
> > Windows dev tools are not famous for being Java friendly. I think
> > you'd have a lot better luck and certainly less friction with
> > netbeans, IntelliJ or eclipse, all of which run well on Windows.
> > There's a simple example maven POM based project that will work on
> > Windows with all of the above here:
> >
> >
> https://github.com/RandyAbernethy/ThriftBook/tree/master/part3/java/simple_mvn
> >
> > Hope it helps.
> >
> > On Tue, Jan 29, 2019 at 12:03 PM Keerthi N <ke...@gmail.com>
> wrote:
> > >
> > > Hello,
> > >
> > > I'm trying to execute Java server and client for thrift. I'm currently
> > > using windows  so I downloaded thrift.exe file from thrifit offical
> > website
> > > and I'm able to successfully gen java code.
> > >
> > > I have written desired Java server and client code in visual studio
> code
> > > and tried 3 options here separately : added java libraries from
> > > thrift/lib/java ,  downloaded explicit jar file in the same folder as
> the
> > > server/client code is in, downloaded maven and created maven archetype
> > > thrift plugin, with pom.xml file having all required dependencies, Java
> > > Server, client and thrift generated files.
> > >
> > > In all these options my IDE wasn't able to recognize or in other
> > > words throwing error import org.apache.thrift / different classes such
> as
> > > TTransport does not exist/can not be found.
> > >
> > > Please let me know any possible solutions.
> > >
> > > Thanks,
> > > Keerthi
> >
> >
> >
> > --
> >
> > --
> > Randy Abernethy
> > Managing Partner
> > RX-M, LLC
> > randy.abernethy@rx-m.com
> > o 415-800-2922
> > c 415-624-6447
> >
>

Re: Thrift Java Client in Windows

Posted by "James E. King III" <jk...@apache.org>.
If you use gradle to build your project you could add this to make it pull
in the most recent version:

from: https://mvnrepository.com/artifact/org.apache.thrift/libthrift/0.12.0
(gradle tab):

compile group: 'org.apache.thrift', name: 'libthrift', version: '0.12.0'

or if you want to use ant and maven:

<!-- https://mvnrepository.com/artifact/org.apache.thrift/libthrift -->
<dependency>
    <groupId>org.apache.thrift</groupId>
    <artifactId>libthrift</artifactId>
    <version>0.12.0</version>
</dependency>

You shouldn't have to download anything manually.

- Jim

On Tue, Jan 29, 2019 at 4:28 PM Randy Abernethy <ra...@rx-m.com>
wrote:

> Windows dev tools are not famous for being Java friendly. I think
> you'd have a lot better luck and certainly less friction with
> netbeans, IntelliJ or eclipse, all of which run well on Windows.
> There's a simple example maven POM based project that will work on
> Windows with all of the above here:
>
> https://github.com/RandyAbernethy/ThriftBook/tree/master/part3/java/simple_mvn
>
> Hope it helps.
>
> On Tue, Jan 29, 2019 at 12:03 PM Keerthi N <ke...@gmail.com> wrote:
> >
> > Hello,
> >
> > I'm trying to execute Java server and client for thrift. I'm currently
> > using windows  so I downloaded thrift.exe file from thrifit offical
> website
> > and I'm able to successfully gen java code.
> >
> > I have written desired Java server and client code in visual studio code
> > and tried 3 options here separately : added java libraries from
> > thrift/lib/java ,  downloaded explicit jar file in the same folder as the
> > server/client code is in, downloaded maven and created maven archetype
> > thrift plugin, with pom.xml file having all required dependencies, Java
> > Server, client and thrift generated files.
> >
> > In all these options my IDE wasn't able to recognize or in other
> > words throwing error import org.apache.thrift / different classes such as
> > TTransport does not exist/can not be found.
> >
> > Please let me know any possible solutions.
> >
> > Thanks,
> > Keerthi
>
>
>
> --
>
> --
> Randy Abernethy
> Managing Partner
> RX-M, LLC
> randy.abernethy@rx-m.com
> o 415-800-2922
> c 415-624-6447
>

Re: Thrift Java Client in Windows

Posted by Randy Abernethy <ra...@rx-m.com>.
Windows dev tools are not famous for being Java friendly. I think
you'd have a lot better luck and certainly less friction with
netbeans, IntelliJ or eclipse, all of which run well on Windows.
There's a simple example maven POM based project that will work on
Windows with all of the above here:
https://github.com/RandyAbernethy/ThriftBook/tree/master/part3/java/simple_mvn

Hope it helps.

On Tue, Jan 29, 2019 at 12:03 PM Keerthi N <ke...@gmail.com> wrote:
>
> Hello,
>
> I'm trying to execute Java server and client for thrift. I'm currently
> using windows  so I downloaded thrift.exe file from thrifit offical website
> and I'm able to successfully gen java code.
>
> I have written desired Java server and client code in visual studio code
> and tried 3 options here separately : added java libraries from
> thrift/lib/java ,  downloaded explicit jar file in the same folder as the
> server/client code is in, downloaded maven and created maven archetype
> thrift plugin, with pom.xml file having all required dependencies, Java
> Server, client and thrift generated files.
>
> In all these options my IDE wasn't able to recognize or in other
> words throwing error import org.apache.thrift / different classes such as
> TTransport does not exist/can not be found.
>
> Please let me know any possible solutions.
>
> Thanks,
> Keerthi



-- 

-- 
Randy Abernethy
Managing Partner
RX-M, LLC
randy.abernethy@rx-m.com
o 415-800-2922
c 415-624-6447