Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7876313
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T03:08:56+00:00 2026-06-03T03:08:56+00:00

I have a Netbeans project that has a source folder (outside the Netbeans project

  • 0

I have a Netbeans project that has a source folder (outside the Netbeans project folder). Now, When I compile the source code from the IDE, everything works fine. But, when I use my own build script it gives an error at runtime.

The application depends on several external libraries that I specify using the path element and the corresponding refid attribute in classpath tag (see code below)

Here is my buildfile

<project name="XX" default="dist" basedir=".">

    <property name="dir.src" location="E:/XX git/xx/src"/>
    <property name="nbproj" location="E:/Netbeans Project"/>

    <property name="dir.dist" value="dist"/>

    <path id="libs">
        <fileset dir="${nbproj}/dist/lib">
            <include name="*.jar"/>
        </fileset>
    </path>


    <target name="clean">
        <delete dir="dist"/>
        <delete dir="release"/>
        <delete dir="build"/>
    </target>


    <target name="compile">
        <mkdir dir="build/classes"/>
        <javac srcdir="${dir.src}" destdir="build/classes" includeantruntime="false">
            <classpath refid="libs"/>
        </javac>
    </target>

</project>

When I compile it using ant compile, it compiles all the source files without any error. But, when I execute it using the command

java -cp "E:\Netbeans Project\dist\lib\*;." controller.CZSaw

it creates the application GUI nicely and then when I perform some action, it fails with the following error:

Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
        at javax.swing.ImageIcon.<init>(ImageIcon.java:167)
        at controller.viewsynchronizer.CZViewManager.getIcon(Unknown Source)
        at view.script.CZScriptView.<init>(Unknown Source)
        at controller.script.CZScriptProcessor.<init>(Unknown Source)
        at controller.script.CZScriptProcessor.getInstance(Unknown Source)
        ...

I know it would be difficult to point out some error looking just at the source code. But, as the same code compiled and worked nicely from the IDE, I think there is something wrong with the way I am compiling. Is there any apparent mistake in the buildfile.

Let me know if I missed some useful information here.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T03:08:57+00:00Added an answer on June 3, 2026 at 3:08 am

    Classic mistake: assuming that because “everything worked fine” in one setting means that you’ve done everything right and are blameless for anything that subsequently goes wrong.

    It means that your IDE took care of some things that you’re ignorant of.

    Look at the first class that’s yours:

    controller.viewsynchronizer.CZViewManager.getIcon(Unknown Source)
    

    It looks like your controller is looking for an icon image that’s not in the CLASSPATH.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a NetBeans project that I'm trying to compile manually from command-line ant
We have a netbeans project that has an xsd that we use to create
Has anyone successfully created a NetBeans project that combines Clojure and Java source? I
I am using Netbeans 7.0.1 with a web project that I have imported from
I have a Maven project that has always worked fine in Netbeans, but upgrading
I have a project that I am building with Netbeans 6.1 and I am
Java Newbie here. I have a JFrame that I added to my netbeans project,
I have a NetBeans project set up with a bunch of source classes and
I have a Java project that has just about every class and package depending
I have built my project that has 5 JAR files including my project JAR

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.