Forum     

Go Back   Digit Technology Discussion Forum > Software > Programming
Register FAQ Calendar Mark Forums Read

Programming The destination for developers - C, C++, Java, Python and the lot


Closed Thread
 
LinkBack Thread Tools Display Modes
Old 03-03-2010, 05:53 PM   #1 (permalink)
In The Zone
 
channabasanna's Avatar
 
Join Date: Jan 2007
Location: Bangalore
Posts: 359
Default Running swf files from Java


Hi All,

Is there any way that i can open a flash file from Java. We can open cmd, notepad.exe, mspaint and other executables present in the System32 folder.

Is there anyway i can open the swf file from Java.

Following code, is what i used to open the System32 executables.

Quote:
public class StartingFlash
{
public static void main(String[] args)
{
try
{
Runtime runtime = Runtime.getRuntime();
//Process process = runtime.exec("E:\\FLash\\universe.swf");
System.out.println("Opening the Process");
Process process = runtime.exec("notepad.exe");
process.waitFor();
System.out.println(process.toString()+" is closed, its exit value is "+process.exitValue());
}
catch(Exception e)
{
e.printStackTrace();
}
}
}
This code opens the notepad and waits untill it is closed.
Sameway i tried giving the path of Iexplorer, and the swf file and i got the following Error.

Quote:
java.io.IOException: Cannot run program "E:\FLash\universe.swf": CreateProcess error=193, %1 is not a valid Win32 application
at java.lang.ProcessBuilder.start(Unknown Source)
at java.lang.Runtime.exec(Unknown Source)
at java.lang.Runtime.exec(Unknown Source)
at java.lang.Runtime.exec(Unknown Source)
at demo.StartingFlash.main(StartingFlash.java:14)
Caused by: java.io.IOException: CreateProcess error=193, %1 is not a valid Win32 application
at java.lang.ProcessImpl.create(Native Method)
at java.lang.ProcessImpl.<init>(Unknown Source)
at java.lang.ProcessImpl.start(Unknown Source)
... 5 more
Opening the Process
Waiting for your suggestions
__________________
C2Q Q6600 G0|ASUS Maximus Formula|XMS2 1GB x2|CM extreme Power 600W|CM Elite 332|WD 320GB HDD|Seagate 80GB HDD|SONY DVD+RW|Viewsonic VA1912wb 19"|XFX 7600GS|OCZ Vendetta 2|HP dv2601tx|Nokia N73 ME
channabasanna is offline  
Advertisements. Register and be a member of the community to get rid of them.
Advertisement

Closed Thread

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
One Giant Command Line MetalheadGautham Open Source 23 24-05-2008 02:31 AM
Call of Duty 2 ankitsagwekar Gamerz 5 15-11-2006 11:15 AM
Rapidshare & Megaupload Hacks Dharmpal Singh Tutorials 1 07-10-2006 01:36 PM
Viewing Word files at the command line naveenchandran Open Source 2 02-03-2006 08:38 PM
Longhorn Transformation Pack v2.0 aditya1987 QnA (read only) 4 24-11-2005 11:39 PM

 
Latest Threads
- by Charan
- by Charan
- by clmlbx

Advertisement




All times are GMT +5.5. The time now is 03:14 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.

Search Engine Optimization by vBSEO 3.3.2