Problem in executing jar when the folder name has empty space

Hi,
I need to run my java swing application on double clicking the jar file. It works fine when the file path has no empty spaces in the folder name. It doesnt open when the folder name has spaces in between them. Can anyone let me know how to resolve it.
String workingDir = new File("SwingApplication").getAbsolutePath();
String cmd = "java -jar " ++workingDir ++"/SwingApplication.jar";
Runtime.getRuntime().exec(cmd);This works fine when the SwingApplication.jar is inside for eg: c://{color:#ff0000}RunApplication{color}/SwingApplication.jar
but the application doesnt open if the file path is c://{color:#0000ff}Run Application{color}/SwingApplication.jar

javaquests wrote:
..ProcessBuilder pb = new ProcessBuilder("java -jar");
pb.directory(new File(workingDirPath + "/SwingApplication.jar"));
Process p = pb.start();
. but getting an exception
java.io.IOException: Cannot run program "java -jar" (in directory "C:\Run Application\SwingApplication.jar"): CreateProcess error=267, The directory name is invalidWhile..
C:\Run Application\..might be a directory, is..
C:\Run Application\SwingApplication.jar?
I was thinking something more like this (untested)..
String path = workingDirPath + "/SwingApplication.jar";
String[] command = {
     "java",
     "-jar",
     path
ProcessBuilder pb = new ProcessBuilder(command);
Process p = pb.start();BTW - when posting code, code snippets, HTML/XML or input/output, please use the code tags. The code tags protect the indentation anf formatting of the sample. To use the code tags, select the sample and click the CODE button.

Similar Messages

  • My images are still in the catalog, but the Folder name has disappeared. I need to get the folder back into my structure with the images in place

    Help: I have a very well defined folder structure. Folder are located in a Master location and organized by State. Inside of these are my master RAW file folders organized by location. For example: West Virginia > BIRI_RAW_2012, BLFA_RAW_2013, NERI_RAW_2013, etc. After I set up the masterful following a shoot, I go to LR and import the images. At one time I inadvertently imported the NERI_RAW_2013 masterful set as a subset of something else and it was not appearing in my LR Module in the organization I prefer. So I went to my master folders on my drive and moved the NERI file into the West Virginia state folder. When I went back to LR, as expected the NERI folder was grey with a question mark. So I right clicked to find the files and relink, and it did not work. The folder name disappeared. The RAW files are still in the catalog and show up in a missing photos search. I can't reimport because they are already there. I just need to restore my folder structure and get the images back to the right spot.

    So I right clicked to find the files and relink, and it did not work. The folder name disappeared.
    It didn't disappear, it moved (because you told Lightroom to move it). It moved from the incorrect folder location, to the new folder location. Please look in the new folder, in whatever location it is in, not in the old folder and the old location, and you will find the photos.

  • There are question marks on each directory although the Folder name is green

    Hi, I have just upgraded to Lightroom version: 3.5 [775451]. When I opened Lightroom it's not able to find my pictures which are stored on a NAS. I have had this problem before, so I don't believe it has anything to do with the upgrade. On the folder name it looks like Lightroom can see my NAS because the small square is green, but for each folder below there is a question mark. When I Ctrl click on one picture and select Show in Finder, it's saying that the original file could not be found. It show the previous location which is still the correct location. CLicking on the Locate a Finder window opens and I can now see a new directory (folder) with the same name as my NAS drive has, and there is of course no pictures in that folder. Where did this new folder comes from with the same name as my NAS ?
    I appriciate all help.
    Thank you
    Cheers
    Bent

    benta151253 wrote:
    ... So maybe the problem is somewhere else ??
    /Bent
    I'm pretty sure the problem lies somewhere else, because I see it happen in other programs also (i.e. iTunes, simple batch scripts, ...). It might be a shortcoming of some API used in these programs.
    Beat

  • How to access a url in file receiver CC with space in the folder name?

    Hi
    PI 7.11 sp4:
    In a file receiver channel I would like to send the message to this folder:
    de-prod.dk\bu\something\something\PTI eventstanden\archive\"
    But I get this error message:
    "Target directory 'F:\usr\sap\XP7\DVEBMGS02\j2ee\cluster\server0\"\de-prod.dk\bu\something\something\PTI eventstanden\archive"' does not exist"
    My question is: where the f.... does it get the 'F:\usr\sap\XP7\DVEBMGS02\j2ee\cluster\server0\  from, and how can I fix it?
    One issue is the space in the folder name. I have tried to replace the space with %20 and then remove the "" s around the whole url, but without any luck.
    When I log on the server on which Pi is running I can access the folder using the mentioned url including the ""s.
    All suggestions would be highly appreciated!
    MIkael

    > But I get this error message:
    >
    > "Target directory 'F:\usr\sap\XP7\DVEBMGS02\j2ee\cluster\server0\"\de-prod.dk\bu\something\something\PTI eventstanden\archive"' does not exist"
    >
    > My question is: where the f.... does it get the 'F:\usr\sap\XP7\DVEBMGS02\j2ee\cluster\server0\  from, and how can I fix it?
    It comes from the "
    Anything else but \ is treated as local folder under working directory of PI
    > One issue is the space in the folder name. I have tried to replace the space with %20 and then remove the "" s around the whole url, but without any luck.
    It works for me just to copy the folder from Windows explorer into channel config. With space and without ".

  • Getting the folder name of the service in Tomcat 5.5

    Hi,
    I am using Tomcat 5.5.
    I have a problem getting the folder name my service is located in.
    Ex.
    \webapps\myApp\...
    Here i would like the string "myApp" - does anyone know how to get this?
    The reason for this is that i use a war file to deploy "myApp". I have a set of properties which i don't want to change so I put them in a file outside "myApp" called "myApp.properties". I can then easily change between a test environment and my online environment.

    I don't think you understand his answer.
    Reading properties files from the file system directly is a mediocre solution at best for a web application. Even if it happens to work in this particular situation.
    For example you would be better off loading properties from a single properties file as classpath loaded resources and simply using the context as a key to the properties in question. You could also configure this from web environment parameters specific to the web application.
    Anything that puts a hard dependency on a particular file system layout is a bad idea, anything that reads files from within a web application server is likely to be a brittle solution.
    This may work, for you, in your current circumstances, but you need to understand why this is a poor approach in general.

  • How to display the folder name in a webi report at infoview

    Hi all,
    Suppose I have a report named "Test_Report" at location Public folder > Test_Folder> Reports_Folder
    now I want to display the folder name "Test_Folder" using a variable in "Test_Report".
    So that the variable will always display the corresponding folder name of "Test_Report" wherever the report resides.
    Thanks in advance.

    Folder name is located in the breadcrumb
    remove your breadcrumb in your collectionrenderer of the layout set you are using.
    Check the layout set you are using in your KM navigational iview.
    Raghu

  • I have some loops from acid 5 which I have dragged in a folder to the loop browser.  Some of them retain the folder name in the View: and some don't.  I have had some that seem to go in but I can't find them.  Where should I look?

    I have some loops from acid 5 which I have dragged in a folder to the loop browser.  Some of them retain the folder name in the View: and some don't.  I have also had some that seem to go in but I can't find them.  If I try to add them again, I get a msg that they are already there.  Where should I look?

    It may be best to recreate the folder and the smart playlists from scratch.
    tt2

  • How to get the folder name of selected subitem in tree structure?

    Hi All,
               I created a tree structure like below.
             ->Folder1-- 1
                              2
                              3
            ->Folder2-----1
                               2
                               3
                    i.e i have two folders & each folder having the values like above.Now i want to perform some action by clicking on the any of the values.Suppose if i click value 2,i want to do some action.the actions need to perform is varies from floder to to folder.
            So How can i get the folder name of clicked Value?
    Regards,
    Ravi

    Hi Kumar ,
    the below code should help you.
    Register the below action for the leaf node for which u need the subfolder's name above it.
    Worked fine in my system ...hope it does in ur scenario too
    method ONACTIONGET_PATH .
      data : lr_element TYPE REF TO if_wd_context_element,
             lr_node TYPE REF TO if_wd_context_node,
             ls_path type string,
             ls_path_node TYPE string,
             lt_string type TABLE OF string,
             l_lines type i,
             l_lines_1 TYPE i.
      lr_element = wdevent->get_context_element( 'CONTEXT_ELEMENT' ).
    **-> getting the path of the node/leaf
    *which  u had clicked and from that getting the node above it
      ls_path = lr_element->get_path( ).
      SPLIT ls_path at '.' into table lt_string.
    -> remove the first 2 entries as they will contain the view name
      DELETE lt_string FROM 1 to 2.
      l_lines = LINES( lt_String ).
      l_lines_1 = l_lines - 1.
    -> remove the last 2 entries as they will contain the element in the path
      DELETE lt_string  from l_lines_1 to l_lines.
      LOOP AT lt_string into ls_path.
        CONCATENATE LINES OF LT_STRING into ls_path_node SEPARATED BY '.'.
      ENDLOOP.
    **-> getting access to the node above the leaf element
    LR_NODE = WD_CONTEXT->PATH_GET_NODE( path = ls_path_node ).
    lr_element = lr_node->get_element( ).
    **-> Getting the name of the folder...
    *here path is the attribute in my context which stores the name of the folder
    lr_element->get_attribute( EXPORTING name = 'PATH' IMPORTING value = ls_path ).
    endmethod.

  • How to change the folder name in KM

    Hi All,
    As a Enduser I have a got a role who can create His/Her own folder to dump the documents.
    Now my requirement is to change the folder which i have created before......
    It may be root folder or Mid folder.
    Please throw some light on this issue.
    Higher points will be rewarded for the valuable input.
    Thanks in Advance,
    Dharani

    Hi Dharani,
    You can change the folder name using "Rename" option from the context menu of the folder. You can also change the name by selecting Folder -> Details->Actions->Rename.
    Regards,
    Vaishali

  • How to change the folder name in the web report.

    hi experts,
    can anybody give me the solution, how to change the folder name in the web report. any help is appreciated.
    waiting for ur favourable response.
    thanks
    suri

    Hi Tony,
    Yes, the business requires, only to change in the webreport only not in bex and roles. any suggestions will be helpful to me.
    thanks
    surendra

  • How to hide the folder name in a KM Navigation Iview

    Hi,
    Scenario,
    I am using a KM Navigation Iview with LinkListExplorer Layout set. The Folder Name appears at the top of the collection.
    Please can someone tell me how I can hide the folder name for the iview. i.e I do not want the folder name to appear in the iview.
    Appreciate your help.
    Thanks,
    Vaishali

    Folder name is located in the breadcrumb
    remove your breadcrumb in your collectionrenderer of the layout set you are using.
    Check the layout set you are using in your KM navigational iview.
    Raghu

  • How can i get value when the field name is user's defined

    Hi,
    I have a one java method:
    public ResultSet countUserDb(String id) {
    ResultSet rs = null;
    con = dbcon.connect();
    String queryString = ("select count as count from
    db_allocation where user_id='"+id+"'");
    Statement stmt = con.createStatement();
    rs = stmt.executeQuery(queryString);
    When i call it in a jsp file.
    ResultSet counter =db.countUserDb(request.getParameter("id"));
    if(counter.next())
    int x=rs.getInt("count");
    Tomcat said incorrect column name.How can i get the result set when the field name is user's defined.
    Best regards
    Ricky

    You should give the user defined name in the ResultSet.getXXX method to retrieve the column value.
    Example
    SQL:
    Select ename as employeename from emp;
    You should say :
    ResultSet.getString("employeename"); to get the value.
    Alternatively you can retrieve it using column number:
    ResultSet.getString(1);
    Chandar

  • The printing of .pdf file from Project 2013 stops when the file name should be written. Project 2013 crashes. Does someone know what is wrong between Project 2013 and Adobe Acrobat 9?

    The printing of .pdf file from Project 2013 stops when the file name should be written. Project 2013 crashes. Does someone know what is wrong between Project 2013 and Adobe Acrobat 9?

    The Acrobat 9.x product family passed into "End of Support" mid-year of 2013.
    Acrobat 9 support of MS Project via PDFMaker stops with Office 2007.
    For Office 2013 support you must use Acrobat XI (11.0.1) or newer. 
    A good to have reference:
    https://helpx.adobe.com/acrobat/kb/compatible-web-browsers-pdfmaker-applications.html
    Acrobat Pro and Standard DC are what are currently available for purchase. 
    Be well...

  • How can i get the value when the field name is user defined

    Hi,
    I have a one java method:
    public ResultSet countUserDb(String id) {
    ResultSet rs = null;
    con = dbcon.connect();
    String queryString = ("select count(*) as count from
    db_allocation where user_id='"+id+"'");
    Statement stmt = con.createStatement();
    rs = stmt.executeQuery(queryString);
    When i call it in a jsp file.
    ResultSet counter =db.countUserDb(request.getParameter("id"));
    if(counter.next())
    int x=rs.getInt("count");
    Tomcat said incorrect column name.How can i get the result set when the field name is user's defined.
    Best regards
    Ricky

    Hi Ricky
    To access pseudo columns you can specify an alias or use the index on the column (e.g. getInt(1)).
    Chris
    NB: you should use bind variables instead of concatenating the id to the SQL statement.

  • I'm in iPhone 5.  I transfer photos to a Windows 7 PC, using the USB cable.  Lately, the photos are appearing in Windows Explorer within monthly folders, with gibberish titles.  The folder names will be 8 random letters and numeric characters.  I ten

    I'm in iPhone 5.  I transfer photos to a Windows 7 PC, using the USB cable.  Lately, the photos are appearing in Windows Explorer within monthly folders, with gibberish titles.  The folder names will be 8 random letters and numeric characters.  I tend to let photos build up, so there are about 2 years worth of these monthly folders… Between 20 and 25.  This is a huge hassle… I'm unable to tell what months are in each folder, by the folder name.…  Have to open each folder to see which month is in there.  I want to be able to look at all the photos on the iPhone in one view, as I was able to in the past.  How do I stop this foldering of photos, by months??  Thank you.  BC

    I have the same issue. I searched and finally got only one answer is -- Apple suggest customer using iMAC to transfer and backup photos instead of Windows. How great the solution is it!

Maybe you are looking for