• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Jeanne Boyarsky
  • Liutauras Vilda
Sheriffs:
  • Rob Spoor
  • Bear Bibeault
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:
  • Frits Walraven
  • Himai Minh

OSX Java 7 and Printing Problem

 
Ranch Hand
Posts: 281
Mac Eclipse IDE Safari
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Printer: HP_Business_Inkjet_2800
Printer: Officejet_6700
Printer: Officejet_7500_E910
Printer: Photosmart_7510_series__DD4ACC_
Printer: zebra_170xiii_plus_home
Printer: zebra_raw
 
Bartender
Posts: 11445
19
Android Google Web Toolkit Mac Eclipse IDE Ubuntu Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If it is a known issue, did you check the bug database? Someone might have found a workaround.
I also added your question to the Mac OS forum. Maybe some else might be able to help you out.
 
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Jaikiran Pai
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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:
 
David Garratt
Ranch Hand
Posts: 281
Mac Eclipse IDE Safari
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If I look at the CUPS web admin page on my Mac you can see what the differences are between Java 6 & 7.

6 reports just the printer descriptions where 7 reports the queue names and then tags on a class name.

Obviously the breaks existing code and presents me with the problem of how to replicate the existing 6 functionality.

print1.jpg
[Thumbnail for print1.jpg]
print2.jpg
[Thumbnail for print2.jpg]
 
David Garratt
Ranch Hand
Posts: 281
Mac Eclipse IDE Safari
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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!

Regards,
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 ?
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic