[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Problem in launching executable from Java program

Posted on 2006-05-31
12
Medium Priority
?
555 Views
Last Modified: 2008-02-01
Experts,

I am calling an executable from the java program.

pcli get [parameters]

When I execute the above command through the Java program, an annoying DOS Window launches momentarily till the command completes executing. It then closes automatically.

I want to execute the command silently WITHOUT having this window pop-up. Is there a way to do this? Also, when executing the above command, it refreshes my local workspace with files in the repository. If there is a writable file in my workspace, the dos window just hangs because it is waiting for a reponse from me about overrwitting the writable file. Is there a way to force the overwrite?

Thanks
0
Comment
Question by:gvijay1
  • 6
  • 4
  • 2
12 Comments
 
LVL 30

Expert Comment

by:Mayank S
ID: 16804909
Try starting it in background mode:

pcli get [parameters] &
0
 
LVL 24

Expert Comment

by:sciuriware
ID: 16804972
This problem only exists in Windows98.

;JOOP!
0
 
LVL 30

Expert Comment

by:Mayank S
ID: 16805158
Maybe in all versions of Windows.

BTW, you should keep the process-name in a config/ properties-file so that you can change it on the fly.
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 24

Expert Comment

by:sciuriware
ID: 16805202
I tested it on W2000 and XP: no prooblem, on W98SE: black console for some seconds.
It was reported to SUN as a bug, but they consider W98 obsolete: no solution planned.

;JOOP!
0
 
LVL 30

Expert Comment

by:Mayank S
ID: 16805213
I thought the duration of the window flashing also has to do with memory, CPU
0
 
LVL 24

Expert Comment

by:sciuriware
ID: 16805260
No, it comes when the spawn is executed and it goes with the exit of the spawned task.
The cause is some Windows library; you can have this problem also when running batches
without any JAVA around.
I don't remember if it existed in W95 or ME.
It was gone in W2000 and NT4 because the library was rewritten and replaced (16-bit platform).

;JOOP!
0
 
LVL 30

Expert Comment

by:Mayank S
ID: 16805545
Yes, I thought it remained in all versions. Anyway, running it in background mode using & should do the trick, hopefully.
0
 

Author Comment

by:gvijay1
ID: 16807348
I am running this on Win XP and here is the command.

pcli Get -idUserId -pr\\\\server -z -o /projectRoot/folder/File.java &

However, I am still getting the command window that flashes briefly, and this time I am getting the following error on the console.

"The entity (or entities) for "&" could not be loaded."
0
 
LVL 30

Accepted Solution

by:
Mayank S earned 500 total points
ID: 16808003
I think I made a mistake in the command - I guess & was used for running a process in background mode. Will check and let you know (you can also try searching on some Windows manual).
0
 
LVL 24

Expert Comment

by:sciuriware
ID: 16809142
>>>  I think I made a mistake in the command - I guess & was used for running a process in background mode.
Sure, ON UNIX !!!


gvijay1, do you run your java program through   java   or   javaw ???
javaw is the right choice, as it makes no MSDOS window.

;JOOP!
0
 
LVL 30

Expert Comment

by:Mayank S
ID: 16809643
>> Sure, ON UNIX !!!

I use it for starting rmiregistry from my Java program using Runtime.exec () on Windows 2003/ XP and it works fine.
0
 

Author Comment

by:gvijay1
ID: 16812266
I am executing this through the Eclipse runtime, so I am assuming that they use the java command?

HOw can I execute the command via javaw when the program is being run in an environment that was executed with something else?
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses
Course of the Month19 days, 10 hours left to enroll

873 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question