Note that there are some explanatory texts on larger screens.

plurals
  1. POException When Running Exported Program, but not in Eclipse
    text
    copied!<p>I am writing a program and am attempting to export it and send it to someone. When I run the program in Eclipse, it works perfectly well. However, when I export it as a Runnable JAR File and double-click it, it quits and tells me to check the console.</p> <p>Here's the stack trace:</p> <pre><code>javax.imageio.IIOException: Can't read input file! at javax.imageio.ImageIO.read(ImageIO.java:1275) at me.pogostick29.audiorpg.util.PrereleaseChecker.run(PrereleaseChecker.java:29) at me.pogostick29.audiorpg.AudioRPG.main(AudioRPG.java:30) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader.main(JarRsrcLoader.java:58) javax.imageio.IIOException: Can't read input file! at javax.imageio.ImageIO.read(ImageIO.java:1275) at me.pogostick29.audiorpg.window.Window.&lt;init&gt;(Window.java:62) at me.pogostick29.audiorpg.window.WindowManager.setup(WindowManager.java:16) at me.pogostick29.audiorpg.AudioRPG.main(AudioRPG.java:32) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader.main(JarRsrcLoader.java:58) </code></pre> <hr> <p>I think it didn't export the image correctly. Here's how I access the image:</p> <pre><code>BufferedImage myPicture = null; try { myPicture = ImageIO.read(new File("images/audiorpglogo.png")); } catch (Exception e) { e.printStackTrace(); } logo = new JLabel(new ImageIcon(myPicture)); </code></pre> <hr> <p>Also, when i try</p> <p><code>myPicture = ImageIO.read(Window.class.getResource("/images/audiorpglogo.png"));</code></p> <p>I get a stack trace, even when running within Eclipse:</p> <pre><code>java.lang.IllegalArgumentException: input == null! at javax.imageio.ImageIO.read(ImageIO.java:1362) at me.pogostick29.audiorpg.window.Window.&lt;init&gt;(Window.java:70) at me.pogostick29.audiorpg.window.WindowManager.setup(WindowManager.java:16) at me.pogostick29.audiorpg.AudioRPG.main(AudioRPG.java:29) </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload