CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Mar 2010
    Posts
    5

    NetBeans IDE 6.9.1 jar creation

    Hi guys!
    I've got a big problem. I made a program in NetBeans IDE 6.9.1 and I wanted to create a jar file from it. Everything went smoothly, but jar wont just open. When I try to execute it from command line it gives me error. I think error is about being unable to find Icon for JFrame (but I can be wrong). The icon image was in project folder and was running in NetBeans normally. Is it possible that NetBeans didnt pack my files (e.g. images) to .jar?

    Project name: opt3 with FirstFrame (extends JFrame) class

    Error Message in cmd:
    Exception in thread "main" java.lang.NullPointerException
    at javax.swing.ImageIcon.<init><Unkown Source>
    at opt3.FirstFrame.init><FirstFrame.java:24>
    at.opt3.Main.main<Main.java:18>

  2. #2
    Join Date
    May 2006
    Location
    UK
    Posts
    4,473

    Re: NetBeans IDE 6.9.1 jar creation

    Is it possible that NetBeans didnt pack my files (e.g. images) to .jar?
    Yes that is possible.
    The thing to do is to look in the jar and see what is in it. A Jar file is basically a zip file so any unzip program will be able to open it. If you don't have access to an unzip program rename the .jar file to .zip and (assuming you are a Windows machine) you will be able to open it as a compressed folder.
    Posting code? Use code tags like this: [code]...Your code here...[/code]
    Click here for examples of Java Code

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured