This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Product Version: NetBeans IDE Dev (Build 201212050001) Updates: Updates available Java: 1.7.0_06; Java HotSpot(TM) Client VM 23.2-b09 Runtime: Java(TM) SE Runtime Environment 1.7.0_06-b24 System: Linux version 3.0.0-12-generic running on i386; UTF-8; cs_CZ (nb) User directory: /home/cesilko/.netbeans/dev Cache directory: /home/cesilko/.cache/netbeans/dev Description: ============ Open action on PDF data node only asks user to specify command for external PDF viewer. This is a regression and a step backward though, because in NetBeans 7.2.1 this worked out of the box. Steps to reproduce: =================== 1. Invoke "Windows > Favorites" from main menu. 2. Navigate to some folder containing PDF files. 3. Double click any PDF node. 4. "Select PDF Viewer" dialog pops up instead of opening the PDF externally automatically.
It works correctly for me. Java Desktop API (java.awt.Desktop) is used to open PDF files. The implementation has not been changed since NetBeans 7.2. It seems that PDF Viewer is not correctly configured in your system. What Linux distribution do you use?
I am on Linux Mint 12. However, I repeat that NetBeans 7.2.1 opens PDF files on the same system without any problems.
(In reply to comment #2) > I am on Linux Mint 12. However, I repeat that NetBeans 7.2.1 opens PDF files on > the same system without any problems. Please, could you try it again, with 7.2.1 running on the same JDK as 7.3, and check IDE Logs if there is something useful? Do you use KDE, Gnome 3, Gnome 2, XFCE or something else? Thank you very much.
I've just checked XUbuntu 12.04 on OpenJDK 7 and it works fine. I'll be able to test it with Ubuntu on Oracle JDK. Unfortunately, I have currently no Mint installation, but I guess that standard Ubuntu with Unity should be very similar to Mint with Gnome.
> I'll be able to test it with Ubuntu (Unity) on Oracle JDK. Works as expected, too.
> Please, could you try it again, with 7.2.1 running on the same JDK as 7.3, and > check IDE Logs if there is something useful? > Do you use KDE, Gnome 3, Gnome 2, XFCE or something else? I haven't been able to reproduce the bug yet. Closing for now. Please reopen if you can provide more information. Thank you.
So I checked this again and it's really strange. I tested 7.2.1 a 7.3 RC with JDK 7 Update 6 to 11 and found out that the problem is caused by Update 11. Both 7.2.1 and 7.3 RC open PDF files just fine if it's run on JDK 7 Update 10 or older. Can you please test it too Jardo? Thanks.
(In reply to comment #7) > So I checked this again and it's really strange. I tested 7.2.1 a 7.3 RC with > JDK 7 Update 6 to 11 and found out that the problem is caused by Update 11. > Both 7.2.1 and 7.3 RC open PDF files just fine if it's run on JDK 7 Update 10 > or older. Can you please test it too Jardo? Thanks. Thank you. I tried other JDKs, but I still cannot reproduce the bug. I've just tested it on Ubuntu 12.04 LTS (Unity) with JDK 7u10, 7u11 and 7u13 (all 32 bit) and everything worked fine for me.
Can I help diagnose the problem somehow? What's the code executing the command? Is there some verbose NetBeans option that would give you more details? If you write a testing class with some debug logging I can run it on my configuration to help us understand what's going on.
BTW, my system is 64b.
> Is there some verbose NetBeans option that would give you more details? No, but that's a good idea to log the exception, thanks. The error occurs probably in Desktop.open(File). If it fails to open a file, it will now log error message and stack trace to the IDE Log. http://hg.netbeans.org/core-main/rev/cebf2c7e6486
Integrated into 'main-golden', will be available in build *201302132300* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-golden/rev/cebf2c7e6486 User: Jaroslav Havlin <jhavlin@netbeans.org> Log: #223331: Log exception if java.awt.Desktop fails to open a PDF file
Created attachment 132058 [details] Message.log containing exception when opening PDF file The IDE indeed threw an exception. Does this help fix the problem?
You know what? It seems like a JDK issue, because the same IDE opens PDF files normally if JDK 7 Update 15 is used. Strange. :|
(In reply to comment #14) > You know what? It seems like a JDK issue, because the same IDE opens PDF files > normally if JDK 7 Update 15 is used. Strange. :| Yes, it may a bug, or the Desktop API is not really supported by older JDKs on your system. INFO [org.netbeans.modules.pdf.PDFOpenSupport]: java.awt.Desktop.open() failed. java.lang.UnsupportedOperationException: Desktop API is not supported on the current platform at java.awt.Desktop.getDesktop(Desktop.java:144) [catch] at org.netbeans.modules.pdf.PDFOpenSupport.open(PDFOpenSupport.java:105) at org.openide.awt.ActionDefaultPerfomer.actionPerformed( ActionDefaultPerfomer.java:70) I would say that NetBeans IDE itself works correctly. It tries to use a service (Java Desktop API), and if it is not available, a fallback method (ask for path to PDF viewer) is used. So I think there is no better fix for this situation. At least it's good news that it works fine with the latest JDK, it's a helpful information. Thank you for checking it.