Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8144683

HostServices.showDocument does not work on Ubuntu 14.04

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P4 P4
    • None
    • 8u60
    • deploy
    • x86
    • linux_ubuntu

      FULL PRODUCT VERSION :
      java version "1.8.0_66-ea"
      Java(TM) SE Runtime Environment (build 1.8.0_66-ea-b02)
      Java HotSpot(TM) 64-Bit Server VM (build 25.66-b02)


      ADDITIONAL OS VERSION INFORMATION :
      Ubuntu trusty 14.04

      A DESCRIPTION OF THE PROBLEM :
      Using HostServices.showDocument to show a .pdf file or display a folder does nothing on Ubuntu 14.04 - the same software runs correctly on Windows and Apple Mac platforms.

      ADDITIONAL REGRESSION INFORMATION:
      Try to show a pdf file with HostServices.showDocument

      ACTUAL -
      Nothing happens

      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      HostServices hostServices= InetSure.application.getHostServices();
      String path;
       if(filePath.charAt(0)==File.separatorChar) path= "file://" + pathOrURL;
       else path= "file:///" + pathOrURL;
       hostServices.showDocument(path);
      ---------- END SOURCE ----------

      CUSTOMER SUBMITTED WORKAROUND :
      use Desktop instead of HostServices:
      SwingUtilities.invokeLater(()->
       {try
        {Desktop.getDesktop().open(new File(filePath));
         }catch(IOException exc) { // handle exception }
       });


            vdrozdov Victor Drozdov (Inactive)
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: