public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Andrey Repin <anrdaemon@yandex.ru>
To: "Andy Hall" <fixpertise-consulting@comcast.net>, cygwin@cygwin.com
Subject: Re: Simple .cmd file works under Cygwin but not Window's cmd interpreter.
Date: Sat, 05 Mar 2016 21:50:00 -0000	[thread overview]
Message-ID: <113344667.20160306004441@yandex.ru> (raw)
In-Reply-To: <002c01d176fc$ba3ed090$2ebc71b0$@comcast.net>

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...

  reply	other threads:[~2016-03-05 21:50 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-05 16:33 Andy Hall
2016-03-05 21:50 ` Andrey Repin [this message]
2016-03-07 18:46   ` Andy Hall

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=113344667.20160306004441@yandex.ru \
    --to=anrdaemon@yandex.ru \
    --cc=cygwin@cygwin.com \
    --cc=fixpertise-consulting@comcast.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).