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

04-18-2008, 09:36 AM
|
 |
Senior Member
|
|
Join Date: Apr 2008
Posts: 101
|
|
|
[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?
|
|

04-18-2008, 09:41 AM
|
 |
Senior Member
|
|
Join Date: Apr 2008
Location: Delhi(India)
Posts: 249
|
|
|
Hello,
Simply use
Process process = Runtime.getRuntime().exec("notepad.exe");
Sanjeev
|
|

04-18-2008, 09:59 AM
|
 |
Senior Member
|
|
Join Date: Apr 2008
Posts: 101
|
|
|
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.
|
|

04-18-2008, 12:13 PM
|
 |
Moderator
|
|
Join Date: Aug 2007
Location: London, UK
Posts: 239
|
|
|
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.
|
|

04-18-2008, 12:19 PM
|
 |
Moderator
|
|
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 3,486
|
|
Originally Posted by sanjeevtarar
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.
|
|

04-18-2008, 12:19 PM
|
 |
Senior Member
|
|
Join Date: Jan 2008
Location: Cebu City, Philippines
Posts: 526
|
|
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
|
|

04-18-2008, 12:21 PM
|
 |
Moderator
|
|
Join Date: Aug 2007
Location: London, UK
Posts: 239
|
|
|
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.
|
|

04-18-2008, 12:27 PM
|
 |
Senior Member
|
|
Join Date: Apr 2008
Location: Delhi(India)
Posts: 249
|
|
Originally Posted by Eranga
Sanjeev, this is only for Windows and Linux, not for Mac OS 
Thanks Eranga for correcting me.
sanjeev
|
|

04-18-2008, 12:31 PM
|
 |
Moderator
|
|
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 3,486
|
|
Originally Posted by jazz2k8
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.
|
|

04-18-2008, 12:33 PM
|
 |
Moderator
|
|
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 3,486
|
|
Originally Posted by sanjeevtarar
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.
|
|

04-18-2008, 12:34 PM
|
 |
Moderator
|
|
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 3,486
|
|
Originally Posted by DonCash
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.
|
|

04-18-2008, 12:38 PM
|
 |
Moderator
|
|
Join Date: Aug 2007
Location: London, UK
Posts: 239
|
|
|
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.
|
|

04-18-2008, 12:54 PM
|
 |
Moderator
|
|
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 3,486
|
|
Originally Posted by DonCash
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.
|
|

04-18-2008, 01:29 PM
|
 |
Senior Member
|
|
Join Date: Apr 2008
Posts: 101
|
|
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.
|
|

04-18-2008, 01:36 PM
|
 |
Moderator
|
|
Join Date: Aug 2007
Location: London, UK
Posts: 239
|
|
|
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.
|
|

04-18-2008, 01:41 PM
|
 |
Senior Member
|
|
Join Date: Apr 2008
Posts: 101
|
|
|
it will take files..because...in that folder watching job (workfolw) is there so we can go with that.
|
|

04-18-2008, 01:43 PM
|
 |
Moderator
|
|
Join Date: Aug 2007
Location: London, UK
Posts: 239
|
|
|
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.
|
|

04-18-2008, 01:55 PM
|
 |
Senior Member
|
|
Join Date: Apr 2008
Posts: 101
|
|
|
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.
|
|

04-19-2008, 08:08 PM
|
|
Member
|
|
Join Date: Apr 2008
Location: USA
Posts: 12
|
|
|
I think you type System("cmd.exe");
|
|

05-06-2008, 12:32 PM
|
 |
Senior Member
|
|
Join Date: Apr 2008
Posts: 101
|
|
|
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.
|
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
| | | |