• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

how to run a java program from batch file?

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am unable to run a java program from a batch file that i created.
spiderpackage.EntryPoint is a class file which I am trying to run with a -v option to output something.what should I do to get the output to a file???

echo ^<html^>^<body^>
echo hello^<br^>
call java spiderpackage.EntryPoint
echo ^</body^>^</html^>
 
Ranch Hand
Posts: 104
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Try the following in your batch program:
cat htmlBegTags.txt > output.part1
java spiderpackage.EntryPoint > output.part2
cat htmlEndTags.txt > output.part3
cat output.part1 output.part2 output.part3 > myFile.html
rm output.*
where htmlBegTags.txt contain <html>...
where htmlEndTags.txt contain ...</html>
 
Sheriff
Posts: 3064
12
Mac IntelliJ IDE Python VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The greater-than sign is used to redirect output to a file. It seems like you want the entire batch output in the file so, assuming the script is in mybatch.bat:
mybatch > myfile.html
should do the trick. You probably want to take "call" out of the script. That's used specifically for calling another batch file.
 
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,
sorry for that i could't share you to solve this
patch problem
but i want to learn how to run java program form
a patch file could anyone help me
thanks,
 
Why is the word "abbreviation" so long? And this ad is so short?
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic