Java Forums

Main Menu
Home
Today's Posts
FAQ
Search
Contact Us

Java Network
Java Tips
Java Tips Blog

Sponsored Links





Welcome to the Java Forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:

  • have access to post topics
  • communicate privately with other members (PM)
  • not see advertisements between posts
  • have the possibility to earn one of our surprises if you are an active member
  • access many other special features that will be introduced later.

Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 04-18-2008, 09:36 AM
jazz2k8's Avatar
Senior Member
 
Join Date: Apr 2008
Posts: 101
jazz2k8 is on a distinguished road
[SOLVED] How to Run an .exe using java
Hi Folks

i am using omnipage OCR engine(which is used for OpticalCharacterRecogniazation)
I want to Run its .exe using java but the conditions are

1)It should run from command prompt only
2)The GUI should not popup when i use my code.

the input should be given through my command promptonly.
like
java OCRPROCESS 1.tif,2.tif...soon..




any help?
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 04-18-2008, 09:41 AM
sanjeevtarar's Avatar
Senior Member
 
Join Date: Apr 2008
Location: Delhi(India)
Posts: 249
sanjeevtarar is on a distinguished road
Hello,

Simply use

Process process = Runtime.getRuntime().exec("notepad.exe");



Sanjeev
Bookmark Post in Technorati
Reply With Quote
  #3 (permalink)  
Old 04-18-2008, 09:59 AM
jazz2k8's Avatar
Senior Member
 
Join Date: Apr 2008
Posts: 101
jazz2k8 is on a distinguished road
i know that how to run normal .exe using Runtime class.

Here is my actual requirement...

the input files will be places in one folder(normally .tif images)..i will give those to OCREngine(Omnipage)..it will processes and gives me the output in .txt or .csv fomat

Instead of maula processing (taking .tif image and giving it to OCR) my java code has to do this..but the main condition is nowhere i want to found the GUI of Omnipage.
Bookmark Post in Technorati
Reply With Quote
  #4 (permalink)  
Old 04-18-2008, 12:13 PM
DonCash's Avatar
Moderator
 
Join Date: Aug 2007
Location: London, UK
Posts: 239
DonCash will become famous soon enoughDonCash will become famous soon enough
Can the OCR Engine actually take parameters in the first place?
__________________
Did this post help you? Please
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
me!

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Bookmark Post in Technorati
Reply With Quote
  #5 (permalink)  
Old 04-18-2008, 12:19 PM
Eranga's Avatar
Moderator
 
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 3,486
Eranga has a spectacular aura aboutEranga has a spectacular aura about
Send a message via Yahoo to Eranga
Quote:
Originally Posted by sanjeevtarar View Post
Hello,

Simply use

Process process = Runtime.getRuntime().exec("notepad.exe");



Sanjeev
Sanjeev, this is only for Windows and Linux, not for Mac OS
__________________
Use an appropriate Subject. "Help, urgent!" isn't one.
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

Has someone helped you? Then you can
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
their helpful post.

Want to make your IDE the best?
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Bookmark Post in Technorati
Reply With Quote
  #6 (permalink)  
Old 04-18-2008, 12:19 PM
sukatoa's Avatar
Senior Member
 
Join Date: Jan 2008
Location: Cebu City, Philippines
Posts: 526
sukatoa is on a distinguished road
Send a message via Yahoo to sukatoa
Well, Process has a disadvantage when it comes to passing some parameters on .exe programs and also capturing .exe's output while invoking it....

Try this alternative,

javax.tools.

regards,
sukatoa
Bookmark Post in Technorati
Reply With Quote
  #7 (permalink)  
Old 04-18-2008, 12:21 PM
DonCash's Avatar
Moderator
 
Join Date: Aug 2007
Location: London, UK
Posts: 239
DonCash will become famous soon enoughDonCash will become famous soon enough
If the OCR Engine isn't actually designed to take parameters then I dont think you will be able to do this Jazz.
__________________
Did this post help you? Please
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
me!

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Bookmark Post in Technorati
Reply With Quote
  #8 (permalink)  
Old 04-18-2008, 12:27 PM
sanjeevtarar's Avatar
Senior Member
 
Join Date: Apr 2008
Location: Delhi(India)
Posts: 249
sanjeevtarar is on a distinguished road
Quote:
Originally Posted by Eranga View Post
Sanjeev, this is only for Windows and Linux, not for Mac OS
Thanks Eranga for correcting me.

sanjeev
Bookmark Post in Technorati
Reply With Quote
  #9 (permalink)  
Old 04-18-2008, 12:31 PM
Eranga's Avatar
Moderator
 
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 3,486
Eranga has a spectacular aura aboutEranga has a spectacular aura about
Send a message via Yahoo to Eranga
Quote:
Originally Posted by jazz2k8 View Post
but the main condition is nowhere i want to found the GUI of Omnipage.
I'm not clear what you say here pal. Which GUI you talking about?
__________________
Use an appropriate Subject. "Help, urgent!" isn't one.
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

Has someone helped you? Then you can
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
their helpful post.

Want to make your IDE the best?
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Bookmark Post in Technorati
Reply With Quote
  #10 (permalink)  
Old 04-18-2008, 12:33 PM
Eranga's Avatar
Moderator
 
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 3,486
Eranga has a spectacular aura aboutEranga has a spectacular aura about
Send a message via Yahoo to Eranga
Quote:
Originally Posted by sanjeevtarar View Post


Thanks Eranga for correcting me.

sanjeev
No prob pal. I've test that few years back on Mac and failed
__________________
Use an appropriate Subject. "Help, urgent!" isn't one.
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

Has someone helped you? Then you can
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
their helpful post.

Want to make your IDE the best?
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Bookmark Post in Technorati
Reply With Quote
  #11 (permalink)  
Old 04-18-2008, 12:34 PM
Eranga's Avatar
Moderator
 
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 3,486
Eranga has a spectacular aura aboutEranga has a spectacular aura about
Send a message via Yahoo to Eranga
Quote:
Originally Posted by DonCash View Post
If the OCR Engine isn't actually designed to take parameters then I dont think you will be able to do this Jazz.
Hey Don,

All of you talking about character recognition engine, right? If not please correct me.
__________________
Use an appropriate Subject. "Help, urgent!" isn't one.
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

Has someone helped you? Then you can
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
their helpful post.

Want to make your IDE the best?
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Bookmark Post in Technorati
Reply With Quote
  #12 (permalink)  
Old 04-18-2008, 12:38 PM
DonCash's Avatar
Moderator
 
Join Date: Aug 2007
Location: London, UK
Posts: 239
DonCash will become famous soon enoughDonCash will become famous soon enough
Yeah as Jazz said in the first post, he is talking about the Optical Character Recogniazation engine.

I don't know anything about this but we should wait for him to reply before we go any further.

Like I say, if this program cant actually take parameters then he won't be able to do what he wants.

It sounds to me as if everything is set in the OCR GUI. Not the command line..
__________________
Did this post help you? Please
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
me!

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Bookmark Post in Technorati
Reply With Quote
  #13 (permalink)  
Old 04-18-2008, 12:54 PM
Eranga's Avatar
Moderator
 
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 3,486
Eranga has a spectacular aura aboutEranga has a spectacular aura about
Send a message via Yahoo to Eranga
Quote:
Originally Posted by DonCash View Post
It sounds to me as if everything is set in the OCR GUI. Not the command line..
May be, he's talking about a GUI their. We have to wait for his response.
__________________
Use an appropriate Subject. "Help, urgent!" isn't one.
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

Has someone helped you? Then you can
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
their helpful post.

Want to make your IDE the best?
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Bookmark Post in Technorati
Reply With Quote
  #14 (permalink)  
Old 04-18-2008, 01:29 PM
jazz2k8's Avatar
Senior Member
 
Join Date: Apr 2008
Posts: 101
jazz2k8 is on a distinguished road
Sorry for the dalay...

My Requirement is:

All the .tif are stored in a sharepoint when the client clicks it then our OCR engine invokes and start ocring.for this i need to write a java component.What i am thinking is if we go with .exe in our program it will be easy task for us...???
In genaral words..write a java component to watch one folder(file pollar type) ..pick up one tif image send it to ocr ..process it ..give the result(.txt 0r .csv) to back to same folder bresides in sharepoint...

Last edited by jazz2k8 : 04-18-2008 at 01:33 PM.
Bookmark Post in Technorati
Reply With Quote
  #15 (permalink)  
Old 04-18-2008, 01:36 PM
DonCash's Avatar
Moderator
 
Join Date: Aug 2007
Location: London, UK
Posts: 239
DonCash will become famous soon enoughDonCash will become famous soon enough
It would be easy to locate the tif files in a directory and launch the .exe. BUT, if the OCR engine does not take parameters when launching the exe, then you will not be able to do this!
__________________
Did this post help you? Please
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
me!

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Bookmark Post in Technorati
Reply With Quote
  #16 (permalink)  
Old 04-18-2008, 01:41 PM
jazz2k8's Avatar
Senior Member
 
Join Date: Apr 2008
Posts: 101
jazz2k8 is on a distinguished road
it will take files..because...in that folder watching job (workfolw) is there so we can go with that.
Bookmark Post in Technorati
Reply With Quote
  #17 (permalink)  
Old 04-18-2008, 01:43 PM
DonCash's Avatar
Moderator
 
Join Date: Aug 2007
Location: London, UK
Posts: 239
DonCash will become famous soon enoughDonCash will become famous soon enough
So when .tif files are placed into the workflow folder, the OCR automatically starts?
__________________
Did this post help you? Please
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
me!

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Bookmark Post in Technorati
Reply With Quote
  #18 (permalink)  
Old 04-18-2008, 01:55 PM
jazz2k8's Avatar
Senior Member
 
Join Date: Apr 2008
Posts: 101
jazz2k8 is on a distinguished road
The tif s are stored in a sharepoint folder.we need to start ocr.exe through our program and also need to give the tif folder path.then the engine should picks the tifs one after another note that it should run background(Reason the client doesnot knows what is the ocr engine we are using) and gives the text files as output.
Bookmark Post in Technorati
Reply With Quote
  #19 (permalink)  
Old 04-19-2008, 08:08 PM
Member
 
Join Date: Apr 2008
Location: USA
Posts: 12
JavaLovenJoe is on a distinguished road
I think you type System("cmd.exe");
Bookmark Post in Technorati
Reply With Quote
  #20 (permalink)  
Old 05-06-2008, 12:32 PM
jazz2k8's Avatar
Senior Member
 
Join Date: Apr 2008
Posts: 101
jazz2k8 is on a distinguished road
Can anyone tel me this what does this mean?/?

cmd.exe???

How to implement with my requirement..my .exe is omnipage.exe

Thanks
jazz
__________________
visit :
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On