delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2011/03/14/15:55:05

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL,BAYES_00
X-Spam-Check-By: sourceware.org
Message-ID: <4D7E7289.7010602@bopp.net>
Date: Mon, 14 Mar 2011 14:54:49 -0500
From: Jeremy Bopp <jeremy AT bopp DOT net>
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.13) Gecko/20101207 Thunderbird/3.1.7
MIME-Version: 1.0
To: cygwin AT cygwin DOT com
Subject: Re: Autostart Cygwin on Windows boot and run a cygwin command
References: <31144428 DOT post AT talk DOT nabble DOT com> <4D7E5A1D DOT 5030702 AT bopp DOT net> <31147099 DOT post AT talk DOT nabble DOT com> <4D7E6112 DOT 1030405 AT bopp DOT net> <31147631 DOT post AT talk DOT nabble DOT com>
In-Reply-To: <31147631.post@talk.nabble.com>
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

On 3/14/2011 14:21, PeterSmith wrote:
> Ok, so for now lets focus on the contents of the .bat file. I'll have a look
> at the startup of the bat later :)

Excellent idea, especially considering that it's not really a Cygwin
problem at that point. ;-)

> I now have this:
> @echo off
> C:
> chdir C:\cygwin\bin
> bash -c "cd
> /cygdrive/e/solr/apache-solr-4.0-2010-10-12_08-05-48/example/;java
> -Dsolr.solr.home=\"./example-DIH/solr/\" -jar start.jar" 
> 
> 
> But that still gives me the exact same error:
> C:\>start_cygwin.bat
> bash: line 0: cd:
> /cygdrive/e/solr/apache-solr-4.0-2010-10-12_08-05-48/example/: No such file
> or dir
> ectory
> Unable to access jarfile start.jar
> C:\cygwin\bin>

I think the "Unable to access..." error message is actually coming from
java.exe.  That's likely because the cd before the java call failed
first, so you're not in the directory you expect to be when java is
started.  Make sure you don't have a typo in that path to which you're
trying to cd.

You may also consider replacing the ; in the command with && so that the
java command is never run if the cd fails.

-Jeremy

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019