Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I run cygwin from Java?

Tags:

java

I want to start nutch from Java. How can I start cygwin from a Java program?

like image 426
Sunil Avatar asked Sep 19 '25 22:09

Sunil


2 Answers

First of all you have to set the bash.exe to environment variable so this line will start bash.

Runtime rt= Runtime().getRuntime().execute("bash");
like image 177
Bindas Avatar answered Sep 22 '25 13:09

Bindas


Rather than use Java to start Cygwin in order to invoke nutch you should probably look into integrating Nutch directly with your Java app. There's some documentation here:

"While the Nutch web app is a great way to get started with search, most projects using Nutch require the search function to be more tightly integrated with their application. There are various ways to achieve this, depending on the application. The two ways we'll look at here are using the Nutch API and using the OpenSearch API."

like image 33
Adamski Avatar answered Sep 22 '25 13:09

Adamski