Stanley Smith

Greenhorn
+ Follow
since Sep 05, 2002
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Stanley Smith

This is a sample of how I try to javac in 1.1.8 with 1.4 as my standard VM for ANT (through IDEA). If anyone knows how to ensure that the VM for the java task is 1.1.8 please share, I am having trouble getting the java command to run in 1.1.8. The help pages on ANT's java task say to set fork="true" to run in a different VM than the main ANT VM. But can't figure out to saw what VM that is.


<target name="robscompile" depends="init">
<javac srcdir="${src}"
destdir="${build}"
fork="yes"
executable="c:/jdk1.1.8/bin/javac"
compiler="javac1.1"
verbose="yes"
target="1.1"
memorymaximumsize="128m"
memoryinitialsize="128m"
/>
</target>
19 years ago
Hey there... assuming that the executable path to Word is as i recorded... and the file name is MYFILE.doc you could use the following.
String[] cmdArray = new String[2];
cmdArray[0] = "c:\\Program Files\\Microsoft Office\\Office10\\winword.exe";
cmdArray[1] = "c:\\My Documents\\MYFILE.doc";
try {
Runtime.getRuntime().exec(cmdArray);
} catch (Exception exc) {}
Hope this helps!
Robin
21 years ago