473,396 Members | 1,971 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,396 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 1869
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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.