I know Java 7 on OSX seems to have known printing problems. Below is a simple test program and when it's run under Java 6 & 7 I get different results. I was wondering if anyone has found a workaround or knows if Oracle are likely to fix it.
1.6.0_65 Number of print services: 5
Printer: HP Business Inkjet 2800 (Howard)
Printer: Officejet 6700 (Brian)
Printer: Officejet 7500 (Simon)
Printer: Photosmart 7510 series (Home)
Printer: Zebra 170XiIII Plus (Home)
1.7.0_45 Number of print services: 6
I don't think it's a bug. If you look at the javadoc of PrintServiceLookup class http://docs.oracle.com/javase/7/docs/api/javax/print/PrintServiceLookup.html it states that it looks up the print services using the "service loader mechanism" on jars within the classpath. So the result will actually depend on what the classpath jars are (this even includes jars that maybe be part of the JRE). So there's no "right" number of services you can expect this API to return, unless of course the classpath has the same jars across JRE versions.
I read your output more closely now and I guess you are concerned both about the number of services output as well as the names that show up differently on different versions. As for the names, as stated in the http://docs.oracle.com/javase/7/docs/api/javax/print/PrintService.html#getName%28%29 method javadoc, it isn't a user friendly name that's returned and it doesn't necessarily have to be the same across versions. What you might want to use is the PrinterName attribute which I think you can get as:
Well - I've filled in a bug report and got back an email with a bug report in it as follows.
Dear Java Developer,
Thank you for reporting this issue.
We have determined that this report is a new bug and have entered the bug into our bug tracking system under Bug Id: 9009133 . You can look for related issues on the Java Bug Database at http://bugs.sun.com.
We will try to process all newly posted bugs in a timely manner, but we make no promises about the amount of time in which a bug will be fixed. If you just reported a bug that could have a major impact on your project, consider using one of the technical support offerings available at Oracle Support.
Thanks again for your submission!
Java Developer Support
HOWEVER I've not been able to lookup the bug id using the 9009133 number. I'm not sure that I've submitted the bug via the correct website or maybe I need to look it up via another method. Does anyone have any experience of this ?