delorie.com/archives/browse.cgi | search |
X-Recipient: | archive-cygwin AT delorie DOT com |
DomainKey-Signature: | a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id |
:list-unsubscribe:list-subscribe:list-archive:list-post | |
:list-help:sender:date:from:reply-to:message-id:to:subject | |
:in-reply-to:references:mime-version:content-type | |
:content-transfer-encoding; q=dns; s=default; b=dg9+ou6a+sd1krLc | |
JUpfUZAXSgfWedqAoa6mlep7hnXM6zyj5oA72eCYXKCi/Zl97WMp0+oC+Sk3NINp | |
TSssTDK+oz9pWyy9bC3k+6zzzhi7thB0RYRk55l4i5vFGprJHBVkBhzeO8u/HLtV | |
cOChvO/oWi+BHQhTX2hmEaTR8NU= | |
DKIM-Signature: | v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id |
:list-unsubscribe:list-subscribe:list-archive:list-post | |
:list-help:sender:date:from:reply-to:message-id:to:subject | |
:in-reply-to:references:mime-version:content-type | |
:content-transfer-encoding; s=default; bh=0kukgGafgC0p+XRdvAr96d | |
K6Vso=; b=NWVBHGo+dJTWl0INu1TDRGeHFlpXKXol15liwvqsf9dngJS72Kbv9d | |
tLz4J1/AOvoM+kYfv9G4blW2U/gSw5BNN7Y0pC0lcwyIlYWmST60WkgEP9k7fwYm | |
fwL5Xoa8zampNMF7Wn1CmmgLDRisW9MGhYePzndhABcxPC/lluk/o= | |
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 |
Authentication-Results: | sourceware.org; auth=none |
X-Virus-Found: | No |
X-Spam-SWARE-Status: | No, score=4.0 required=5.0 tests=AWL,BAYES_50,FREEMAIL_FROM,KAM_THEBAT,MIME_BASE64_BLANKS,SPF_SOFTFAIL autolearn=no version=3.3.2 spammy=H*UA:Bat!, H*x:Bat!, H*r:sk:postmas, H*R:U*cygwin |
X-HELO: | smtp.ht-systems.ru |
Date: | Sun, 6 Mar 2016 00:44:41 +0300 |
From: | Andrey Repin <anrdaemon AT yandex DOT ru> |
Reply-To: | cygwin AT cygwin DOT com |
Message-ID: | <113344667.20160306004441@yandex.ru> |
To: | "Andy Hall" <fixpertise-consulting AT comcast DOT net>, cygwin AT cygwin DOT com |
Subject: | Re: Simple .cmd file works under Cygwin but not Window's cmd interpreter. |
In-Reply-To: | <002c01d176fc$ba3ed090$2ebc71b0$@comcast.net> |
References: | <002c01d176fc$ba3ed090$2ebc71b0$@comcast.net> |
MIME-Version: | 1.0 |
X-IsSubscribed: | yes |
X-MIME-Autoconverted: | from base64 to 8bit by delorie.com id u25LoQna008935 |
Greetings, Andy Hall! > This is a puzzle that I have not been able to sort out despite trying all > sorts of variations. Basically, I maintain a bunch of Crystal Reports based > on Crystal reports XI R2. Sorry, I have no choice there. > I have this installed and running on a Widows 10 machine. How I did that is > another story. > Recently I was asked what it would take to internationalize these reports. > Fortunately, CR has a mechanism that allows you to define your own functions > that can be used in reports which allow you to access properties files > containing the localized entities just as you would for a > normal Java app. All well and good. > So I set about trying to get this to work. The plugin to CR XI R2, is not > well integrated with the base system and a bit of not so nice manual > configuration is necessary. > You have to follow this to the letter, but that is not sufficient. > Out of the box I could not get it to work. So to debug what was going on I > wrote a simple bash script to try to get it to work. > Lo and behold this simple script works: > #!/bin/bash > echo " " > echo "CLASSPATH = $CLASSPATH" > echo " " > #JAVA_HOME=C":\Program Files (x86)\Java\jdk1.6.0_45" > echo "JAVA_HOME = $JAVA_HOME" > echo " " > echo "PATH = $PATH" > cd "/cygdrive/c/Program Files (x86)/Business Objects/Crystal Reports 11.5" > java -version > crw32.exe > Notice that this seem to do nothing but display some key variables and the > run CR in its installation directory, just as the normal shortcut does. > It launches CR which finds the plugin and loads it. > Now I have a need to do the same outside of the Cygwin environment, so I > wrote a simple equivalent .cmd file: > @Echo off > :: Display CLASSPATH > set CLASSPATH echo %CLASSPATH% > :: Set and display JAVA_HOME > ::set JAVA_HOME=C:\Program Files (x86)\Java\jdk1.6.0_45 > set JAVA_HOME echo %JAVA_HOME% > :: Add 32-bit JDK to PATH and display > ::set PATH=%JAVA_HOME%\bin;%PATH% > set PATH Just start Java from %ProgramData%\Oracle\Java\javapath\java.exe In truth, it IS ALREADY in your %PATH%, if you didn't removed it. > pushd C:\Program Files (x86)\Business Objects\Crystal Reports 11.5 CD /D "C:\Program Files (x86)\Business Objects\Crystal Reports 11.5" > java.exe -version > crw32.exe > popd > If I run this from a bash command prompt it works as well. It also works > if I launch cmd from bash and then run the cmd > file. That makes sense. > But here is the puzzle, If I simply click on the runCR.cmd file, say from > the file explorer, CR launches but does not find the plugin. > The same happens if I launch a Windows cmd window and run the cmd file outside of Cygwin. Then the environment is different. "set > file" in both CMD prompts and diff the output. > So the question is: “What could possibly be the difference between the > Cygwin environment and the Windows cmd environment that makes this work in > one and not the other?” > I have examined the PATH used in the Cygwin environment and set the PATH in > the Windows environment to be identical. No change. It may be some other environment variable. > I thought it might have to do with whether or not a 32-bit or 64-bit JVM is > configured in the path, but that does not seem to make a difference. > It fails if the JVM in the path is 32-bit or 64-bit probably because CR > really gets its JVM from a registry setting. > I am at a loss, Does anybody have an idea? > BTW, I would have expected the reverse to be the case: works in Windows but not Cygwin. If I were you, I'd remove all Java versions and then install only one, and see if it works or not. -- With best regards, Andrey Repin Sunday, March 6, 2016 00:31:40 Sorry for my terrible english...
webmaster | delorie software privacy |
Copyright © 2019 by DJ Delorie | Updated Jul 2019 |