title: Java simple print to a USB interface
body: <p>I have a Java application which print a simple string to a label printer, which is connected on the parallel centronics interface of the PC.</p>
  
  <pre><code>try 
  {
    PrintStream printStream = new PrintStream(new FileOutputStream(“LPT1”));
    printStream.print(“Hello World”);
    printStream.close();
  } 
  catch (Exception exception) 
  {
    System.out.println("printer error");
  }
  </code></pre>
  
  <p>This works without problem.</p>
  
  <p>I connected the label printer to the USB interface of the PC and I installed the printer USB driver. The printer is mapped to the USB002. I replaced “LPT1“ by “USB002“. But it doesn’t work.</p>
  
  <p>How can I do a simple printing to the label printer using the USB port, without to enter each time in the printer selection window?</p>