my dog learned polymorphism*
The moose likes General Computing and the fly likes Converting shell script to a batch file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Engineering » General Computing
Bookmark "Converting shell script to a batch file" Watch "Converting shell script to a batch file" New topic
Author

Converting shell script to a batch file

Svend Rost
Ranch Hand

Joined: Oct 23, 2002
Posts: 904
Hi,

I suspect, that the reason that im getting problems with a program is that
im running part of it as a shell script (in Cygwin), while the rest is run
in dos/windows, which is why I'd like to convert a shell script into a bat file.

This line of "code" get's executed as the last line in the shell script:


but it wont run when I type it in DOS.

Btw.


I need to execute the BlahBlahCompiler, which is located somewhere in
the BlahBlah.jar file located in the BLAH_HOME directory (c:\BlahBlah\),
but im not quite sure how. Im furthermore not sure if I need the -classpath
stuff, or the -Dprogram.name stuff either.

When I run:
java -Dprogram.name=BLAHPROGRAM -classpath "c:\BlahBlah" edu.cmu.cs.X.Y.Z.runtime.BlahBlahCompiler
I get an java.lang.NoClassDefFoundError and then the path that im trying to execute (c:\BlahBlah/edu/cmu/cs/X/Y/Z/runtime/BlahBlahCompiler)

Any help will be appriciated.

/Svend Rost
Jeroen T Wenting
Ranch Hand

Joined: Apr 21, 2006
Posts: 1847
The $ signs in there are Unix specific. Windows uses % signs instead.


42
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15299
    
    6

Moving to General Computing...


GenRocket - Experts at Building Test Data
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61084
    
  66

I suspect, that the reason that im getting problems with a program is that im running part of it as a shell script (in Cygwin), while the rest is run in dos/windows


I do this all the time. I suspect you may be chasing a red herring.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Svend Rost
Ranch Hand

Joined: Oct 23, 2002
Posts: 904
Originally posted by Bear Bibeault:


I do this all the time. I suspect you may be chasing a red herring.


Thanks for replying. Im not quite sure, I understand what you mean with
a red herring.

I found this description of a red herring:
Topic A is under discussion.
Topic B is introduced under the guise of being relevant to topic A (when topic B is actually not relevant to topic A).
Topic A is abandoned.

Are you saying, that my assumption (that it doesn't work 'cause
it's run in dos and unix) is false?

I believe it to be the cause of the problem, because the "unix things" have
to (a) compile a file of rules and then (b) start a program which monitors
the JMS for certain types of data(xml), and then emit some infomation back to
the JMS. AFAIK, it doesn't emit enough information back and I think it's
cause of the compile/run on unix.
[ July 27, 2006: Message edited by: Svend Rost ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Converting shell script to a batch file