473,327 Members | 2,081 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 software developers and data experts.

running .exe application from java file

15
hi,
I wanna run a few files which are .exe and .jar from a java file as a part of my application...
This is the code that i got frm net
/* Runtime rt = Runtime.getRuntime() ;
Process p = rt.exec("notepad") ; */

i am not able to open other files but its possible by giving their path....... I need to run my application on different systems, i cannot change the path everytime as per the system.....

so please can anyone say me what is the correct code
Thanks in advance
NIKHILESH
Apr 10 '10 #1
1 1866
jkmyoung
2,057 Expert 2GB
The process should automatically take into account the path environment variable.

What program are you trying to run? If notepad, it should almost always be on the path, (unless someone has custom changed it). If it is your own program, then the installation package for your program should add its corresponding installation directory to the path variable.
Apr 12 '10 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Jagdeesh | last post by:
Hai Colleagues, I am using Tomcat 4.1.24 and JDK 1.4.0_03 in my winXP machine. I've transferred a set of folders(containing jsp files) into tomcat's webapps directory(to /webapps/bob ,...
4
by: Laura P | last post by:
Hi, I wasn't sure whether this should be posted in the Java are or in a Solaris thread, so I shall post it in both. Sorry for the duplication. I am new to Solaris and am having trouble...
0
by: Bon Bon | last post by:
I am trying to run the Java PetStore Demo using clouldscape. But my default RMI registry port 1099 is taken by some other program. So I am running cloudscape on port 2001. But then the deployment...
0
by: Peter Bassett | last post by:
I am having a problem running my Java application from a remote folder. My CLASSPATH variable is set to ". ; c:\java" and Path contains c:\java I have an application ListFiles.class in c:\java...
10
by: Tobias Nilsson | last post by:
I have almost exactly the same problem as the guy below. Is it NOT possible running .NET code locally in Internet Explorer WITHOUT a webserver???? / Tobias --------- My company has in the...
1
by: msatya | last post by:
Hi, I developed a swing based application in java. I am running it through the executable jar. Each time clicking on the jar file it opens the new instance of the appliction. But I want...
0
by: shanmukhi | last post by:
Hi All I got a problem in running java programs. i am not able to run java applet while running i got a problem as Loading Java Applet Failed java.lang.NoClassDefFoundError: App (wrong...
0
by: shanmukhi | last post by:
Hi All, i am very new to crystal reports.. how can i run crystal report(rpt file) from a jsp page.. i tried somthing by getting code from google my applicaction structure is like this ...
4
lifeisgreat20009
by: lifeisgreat20009 | last post by:
This is what i am getting on running the program......... C:\PROGRA~1\Java\JDK15~1.0\bin>javac Editor.java Note: Editor.java uses or overrides a deprecated API. Note: Recompile with...
6
by: mjahabarsadiq | last post by:
Hi, I have written a java code to execute ant targets via Servlet. I have given the code below. import org.apache.tools.ant.*; import org.apache.catalina.ant.*; . . . .
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.