Trying to run an archive, file or anything else

Hello, I'm trying to run an archive (An image, a text archive, etc) using the File object...
I was using this code:
        try{ 
            file = new File("D:/gnd_1024_2.jpg");
            r = Runtime.getRuntime();
            r.exec(file.getName());
        }catch (Exception e) {
            e.printStackTrace();
    and an Exception Ocurrer, how Should I do it?
Thnx

You can not "run" an image, you need to run an application to use on the image.
I believe the application "start" will work out which application you have set as the defualt app for a document, and run that. Search the forum for more info on it.

Similar Messages

  • I'm trying to run a .mov file across 2 monitors (making it one giant monitor) but it won't go to full screen. Help, I'm trying to run a .mov file across 2 monitors (making it one giant monitor) but it won't go to full screen. Help

    Hi -
    I'm trying to run a .mov file on a mac mini using 2 monitors - the monitors are set up to make it one large screen.  When I try this it doesn't go to fullscreen, are there any workarounds?
    Thanks!

    I tried the drop and drag but it won't cover the entire screen. It leaves a border around it and is really annoying.  I'm told the next OS will fix this, I'm just trying to find a workaround for this if possible.

  • Trying to run a batch file in ODI and the file is on a windows network drive.

    Hi,
    I'm trying to run a batch file that is located on a windows shared drive for the ODI server. When I try to run the file through OS command by giving the file path in the "command line". I get the error "
    ODI-1226: Step fails after 1 attempt(s).
    ODI-1242: Operating system command execution fails."
    Please let me know if this can be done.

    Hi,
    First try to execute your batch file, if it is executing as expected.
    Then use OdiOSCommand tool and give full path of script and also give a path to create error file & out file.
    Execute the batch now via OdiOSCommand, if it fails then you will receive error message in Error file.
    Also check if you have rights to script being executed via ODI.
    Thanks,
    DK

  • Hi. I am from Greece and I have an I phone 4 and I want to unlock the Bluetooth, because I can't share files or anything else with another I phone or  I Mac or another device. Can you help me please? Thanks.

    Hi. I am from Greece and I have an I phone 4 and I want to unlock the Bluetooth, because I can’t share files or anything else with another I phone or  I Mac or another device. Can you help me please? Thanks.

    Answered here:
    https://discussions.apple.com/message/19977803#19977803
    Re-posting the same question over and over won't change the answer.

  • WrongName error when trying to run a package file

    Hi, I am trying to run a file in a package. The package name is called com.davidflanagan.examples.net and the file name is ProxyServer.class. I've set the class path to point to the directory the package is in using the CLASSPATH environment variable. I've tried using "java ProxyServer" and "java com.davidflanagan.examples.net.ProxyServer", but I get a cryptic Wrong name error in both Windows and Linux. Any help would be greatly appreciated.

    First, ProxyServer's source code must start with the line...
    package com.davidflanagan.examples.net;
    Next, you must have a directory structure that matches the package name - a directory named com which contains a directory named davidflanagan which contains a directory named examples which contains a directory named net and ProxyServer.class must be in the net directory,.
    Next, the directory that contains com must be in your Classpath when you execute ProxyServer.
    To execute ProxyServer, use "java com.davidflanagan.examples.net.ProxyServer"
    http://java.sun.com/docs/books/tutorial/java/interpack/packages.html

  • Trying to run a .jar file but CAN'T!!!!

    I have a .jar file. If I click on it, a Java Virtual Machine Launcher error box comes up that says "Could not find the main class. Program will exit."
    I've tried to run it from the DOS prompt two ways.
    If I type "java -jar Plist" (Plist is the .jar file name, the .java file name, and the class name), It says...
    Exception in thread "main" java.util.zip.ZipException: The system cannot find
    e file specified
    at java.util.zip.ZipFile.open(Native Method)
    at java.util.zip.ZipFile.<init>(Unknown Source)
    at java.util.jar.JarFile.<init>(Unknown Source)
    at java.util.jar.JarFile.<init>(Unknown Source)
    If I type "java -jar Plist.jar", It says...
    Exception in thread "main" java.lang.NoClassDefFoundError: Plist
    Two questions...
    1. What am I doing wrong??
    2. Once I get this .jar deal to work, will I be able to run it on other computers? It seems to be tied in with some of the Java utilities and files on my computer. Is it independent like a .exe file or not?

    1. What am I doing wrong??
    You need a manifest. Open notepad and write these two lines:
    Main-Class: main
    [A blank line, just hit enter]
    For main specify the name of the class that has the Main(String[] args) method without the .class extension. If your using a package, then put the package name in there too like this:
    Main-Class: myPackage/main
    But since you not using a package, and you said the only class is Plist.class then use:
    Main-Class: Plist
    (remember a blank line here)
    Now save this file (call it manifest.txt if you like).
    Next, update your jar file with this command:
    jar umf [name of manifest file] [name of jar file]
    jar umf manifest.txt Plist.jarNow run with this command or double-click from Windoze:
    java -jar Plist.jar2. Once I get this .jar deal to work, will I be able to run it on other computers?
    The other computers must have at least the jre installed, available free from Sun as you know :)
    -Ron

  • D51wkdmp::::Trying to run on corrupt file, ""workbook.Item dependency

    Hi ALL
    I am trying to run that following dump utility on my corrupt DIS File, I am not successful , but if run that following command on my correct file (Working File) it gives me the result.
    d51wkdmp "C:\XX DISCOVERER REPORT.DIS" c:\PA_EXP_DUMP.TXT FS "user:responsibility/passwordn@dev1" Eul_US –f
    My Workbook has error, Cannot join tables used in the workbook.Item dependency “” not found in the EUL
    Thanks
    ASIM

    Try downloading the stand alone installer here:
    http://support.apple.com/kb/DL1399
    In Safari Preferences, General tab, set "Save downloaded files to: select destop, if it is not in thed rop down select other, then selcet Desktop from the left sidebar. After the download completes click on the installer package on your desktop and follow the prompts.
    Also if possible use an ethernet conection as it is less prone to interference, thus less prone to corruption, and usually faster.
    Hope this helps

  • Trying to run a bat file from oracle

    I have followed these steps, see bottom for results, everything is valid but the bat file does not run???? PLease need your help. Doug
    CREATE OR REPLACE AND COMPILE JAVA SOURCE NAMED "getbatx" AS
    class getbatx //class pdfopen
    public static void execmd(String c) //main function
    try
    System.out.println("Executing:" + c);
    Runtime.getRuntime().exec("C:\\WINDOWS\\system32
    cmd.exe /c "+c);
    System.out.println("Executing:" + c + " ...done");
    } catch (Exception e) //catch any exceptions here
    System.out.println("Error" + e ); //print the error
    CREATE OR REPLACE PROCEDURE host_command2 (p_command IN VARCHAR2)
    AS LANGUAGE JAVA
    NAME 'getbatx.execmd (java.lang.String)';
    /Then as sysdba I put in in the following.
    exec dbms_java.grant_permission( 'CAPRS', 'SYS:java.io.FilePermission', '<<ALL FILES>>', 'execute' );
    EXEC Dbms_Java.Grant_Permission('CAPRS', 'SYS:java.lang.RuntimePermission', 'writeFileDescriptor', '');
    EXEC Dbms_Java.Grant_Permission('CAPRS', 'SYS:java.lang.RuntimePermission', 'readFileDescriptor', '');Then I make the call.
    SET SERVEROUTPUT ON SIZE 1000000
    CALL DBMS_JAVA.SET_OUTPUT(1000000);
    BEGIN
    host_command2 (p_command => 'c:\mybook.bat');
    END;
    /***** I run this, it completes but does not run the bat file and there is no error message
    SQL> BEGIN
    2 host_command2 (p_command => 'mybook.bat');
    3 END;
    4 /
    Executing:mybook.bat
    Executing:mybook.bat ...done
    PL/SQL procedure successfully completed.

    Yes it should open a dos box, but you forgot to add the .bat file witch you like to run: String[] command = {"cmd", "/c", "start", "c:/Batch files/Cardiobackup/cardiobackup_v1.4"}

  • In OSB file protocol, trying to get the archived file name in proxy service

    Hi,
      I have a requirement that i need to process the archived file of file protocol,  with java callout in proxy service.
    I am able to get the file name which is reading with 'tokenize($inbound/ctx:transport/ctx:request/tp:headers/file:fileName,"\\")[last()]' , but this file is getting archived to archive folder. I want to pass the archive file name as input to the Java callout.
    Please let me know if  this can achieve in OSB proxy or any other options.
    Note : I am reading a xlsx file in the file protocol

    If you're using pass by reference option in the file transport, I guess the archive filename can be obtained from $body/ctx:binary-content/@ref. Try it out.

  • Trying to run HTML 5 file on IE8

    Is there a way I can run HTML5 published file on IE8? I know the browser does not support HTML 5, but my client is not willing to upgrade to IE9 at this time, so wanted to know what the best possible way to run the HTML5 on IE8.

    The best possible way to run HTML5 on a non-HTML5-compliant web browser is not at all.
    If your client wants to stick with IE8 then they need to be using HTM/SWF output, not HTML5. 
    Why would they be demanding HTML5 output if their default company browser won't support it?

  • Trying to run java class files from my jsp

    I am having difficulty running java files from my jsp. I have compiled my two java classes and inserted them onto my server in the webapps/WEB-INF/classes/scripting directory and have imported scripting.* into my jsp page. The files both compiled ok before the class files were loaded onto the server but when I rty to run the jsp from the server, I keep getting a compiler error. Thanks in advance
    Iob

    Here are the few question
    1) Does your java classes which u created is declared under package scripting. *.class files are to be places under the WEB-INF/classes directory only. Not under scripting. But if you java classes say are under a package called a.b. Then you need to put under classes\a\b\.

  • Trying to run a batch file on a UNC path

    I'm running a pretty simple script that loops through names on machines, and runs batch files.  Here's my code:
    Dim RetVal1 As String
    Dim RetVal2 As String
    RetVal1 = Shell("\\" & Cell & "\c$\Java\bin\service\StopServerService.bat", 1)
    RetVal2 = Shell("\\" & Cell & "\c$\Java\bin\service\StartServerService.bat", 1)
    Each 'Cell' contains a machine name.
    I keep getting a message about UNC paths not being supported.  I could swear this that was working last week!!
    Knowledge is the only thing that I can give you, and still retain, and we are both better off for it.

    I keep getting a message about UNC paths not being supported.  I could swear this that was working last week!!
    I would simplify matters by running this command from a Console (cmd.exe):
    \\ComputerName\c$\Java\bin\service\StopServerService.bat
    Does it work?
    What does StopServerService.bat contain?
    What operating system do the two machines run?
    Is UAC active on the remote machine?
    After solving the problem at the console level you should get further advice from a VBA forum.

  • I have downloaded a new version of Firefox, but can't figure out how to install it. I see the folder with Firefox application in it -- & have tried to run the executable files, but none of them start the installation.

    I have a 3.6.23 Version of Firefox & am trying to upgrade to the latest version

    Hi,
    There's information on that here: [[Installing Firefox on Linux|Installing Firefox on Linux]]
    Jack

  • How do I convert an m4a video file to anything else?

    I need to edit out some video from an iPod converted video file. How do I do this?

    I use a program called iSquint to convert files to iPod or H.264 format. This program can optimize the conversion for iPod or for TV and I think it should be able to convert your m4a files to H.264 for editing. It's free, so even if it doesn't help this particular problem, you can use it for converting other videos to your iPod. Get it at http://www.iSquint.com
    If iSquint turns out to be useless for your purposes, there is also a program called VisualHub which does tons more than iSquint (including conversions for DVD, PSP, AVI, QT, TiVO, Flash, etc) but unfortunately it costs USD $23.32--which still isn't too bad considering what some companies would have you pay for similar functionality. It is linked to from www.iSquint.com or you can go directly to it here: http://www.techspansion.com/visualhub/
    Good luck and hope this helps.

  • How to run a python file on Safari?

    Good day,
    I am trying to run any python file on the Leopard web server, accesing it via safari.
    also I have set the permissions of the file to 777...
    then I have copied the file to library/webserver/documents.When I open this file in Safari, the file is listed, but it is not executed.
    also I have copied the file to library/webserver/cgi-executables, but the file is not executed, an error appears:
    Internal Server Error
    The server encountered an internal error or misconfiguration and was unable to complete your request.
    Please contact the server administrator, [email protected] and inform them of the time the error occurred, and anything you might have done that may have caused the error.
    More information about this error may be available in the server error log
    the python file contains only 2 lines:
    #!/usr/bin/env python
    print 2
    I have tested the file in the command line via python test.py and it runs fine... but I dont know what should I have to do to run it on the browser...
    do I have to enable mime types for python on leopard client? how to do it?
    have a nice day

    Karl Zimmerman wrote:
    Note that the script you've given doesn't produce a valid HTML page. How your browser chooses to render '2' is undefined. However, I don't think this is the problem you're seeing right now...
    Actually, you're right, that is the problem: there's no HTTP header. The script needs this line:
    print 'Content-type: text/html
    before anything else is sent to the browser, and it will work. At least, it works with Apache 1.3 in Tiger, but I'd expect it to be the same with Apache 2.
    charlie

Maybe you are looking for