• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Jeanne Boyarsky
  • Tim Cooke
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Mikalai Zaikin
  • Carey Brown
Bartenders:

Is there any api in java to connect to windows using java from unix machine

 
Ranch Hand
Posts: 93
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Dear Ranchers,

From the java application which is running on a unix box, need to connect to windows machine and need to do some file operations.


Any help highly appreciated.
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What, exactly, does "connect" mean - by which means? Maybe FTP or SFTP would be sufficient?
 
Marshal
Posts: 27996
94
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Or if both systems are connected by a Windows network, then jCIFS might suit your requirements.
 
Rancher
Posts: 618
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Samba allows a Linux box to connect to a windows box so that you can see the Windows file system on a Linux box. Does your version of UNIX support Samba? If you can install Samba, then you can use the regular Java file support. I'll bet you will have more trouble with your IT department than you have with developing your application :)
 
Nevin kumar
Ranch Hand
Posts: 93
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
@Ulf,

When I say connect I mean should be able to access windows from unix machine using a java program.Sometime back I used a ssh client (SFTP connection) for connecting from one mac book to other but I forgot the api .May you suggest any open source and free java api which will full fill my requirement.

@Paul

I need to check whether both the systems are connected in windows Network.



Guys, Thank you very much for your time.
 
Sheriff
Posts: 22772
130
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The most important question still remains, what do you want to do? Execute commands? Read and write files? Something else?
 
Nevin kumar
Ranch Hand
Posts: 93
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Dear Rob,

I need to access a particular folder and check how many files are present and get their names and check the file size of each file not zero.some type of file operations.


 
Rob Spoor
Sheriff
Posts: 22772
130
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Then use Samba (or Windows file sharing), either with File (you may need to mount the share first) or using jCIFS.
 
Nevin kumar
Ranch Hand
Posts: 93
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I had used an open source ssh client api in java.I was successfully able to connect to linux box from windows machine,but when I tried connecting to windows from unix box.It says connection refused.I had no idea what is the problem ?I had given hostName, userId and password.Any suggestions highly appreciated.


java.net.ConnectException: Connection refused


 
Tom Reilly
Rancher
Posts: 618
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Have you opened your Windows box appropriately to the network? (File sharing, firewalls, etc).
 
Rob Spoor
Sheriff
Posts: 22772
130
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
To use SSH you'll need to run an SSH server, and there aren't many SSH servers available for Windows. More importantly, they are never ever installed by default, you'll have to do that yourself. But why not follow the advice you've been given at least twice and use JCIFS in combination with a file share on the Windows machine?
 
And then the entire population worshiped me like unto a god. Well, me and this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic