This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 203051 - Default project can not be compiled from the command line
Summary: Default project can not be compiled from the command line
Status: RESOLVED FIXED
Alias: None
Product: javafx
Classification: Unclassified
Component: Platform (show other bugs)
Version: 7.1
Hardware: PC Mac OS X
: P2 normal (vote)
Assignee: Anton Chechel
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-10-04 13:25 UTC by Petr Jiricka
Modified: 2011-11-01 15:10 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Petr Jiricka 2011-10-04 13:25:51 UTC
1. After setting up the JavaFX platform, create a new JavaFX project
2. From the command line, run ant in the project's root directory

The build fails with the following message:
BUILD FAILED
/Users/petrjiricka/NetBeansProjects/JavaFXApplication2/nbproject/build-impl.xml:955: The following error occurred while executing this line:
/Users/petrjiricka/NetBeansProjects/JavaFXApplication2/nbproject/build-impl.xml:371: The <classpath> for <junit> must include junit.jar if not in Ant's own classpath
Comment 1 David Strupl 2011-10-07 13:42:28 UTC
And you have JUnit installed, correct? Just making sure ;-)
Comment 2 Petr Jiricka 2011-10-07 14:04:52 UTC
Yes I do. The workaround is to create a new JUnit test with a test method - after that, the build passes.
Comment 3 Anton Chechel 2011-10-24 16:12:29 UTC
Works for me.
Could you please check you <userdir>\build.properties? It should contain:
libs.junit.classpath=<path to junit.jar>

Otherwise you didn't download JUnit.
Comment 4 Petr Jiricka 2011-10-26 12:44:20 UTC
Yes, I have installed the JUnit plugin and my <userdir>/build.properties contains:

libs.junit.classpath=/Users/petrjiricka/software/netbeans_webmain_6156/java/modules/ext/junit-3.8.2.jar

libs.junit_4.classpath=/Users/petrjiricka/software/netbeans_webmain_6156/platform/modules/ext/junit-4.10.jar

But it still does not work for me. I am comparing a standard Java SE project with a JavaFX project, and the difference is that an empty FX project contains the "test" directory - Java SE project does not. Consequently, the Projects view of FX project contains the Test Packages and Test Libraries nodes - again Java SE project does not. 

Then I see this in the build-impl.xml file:

        <condition property="have.tests">
            <or>
                <available file="${test.src.dir}"/>
            </or>
        </condition>

So this evaluates to true in an empty FX project, and false in an empty Java SE project, and based on this, some extra targets in the FX project are executed which are not executed in Java SE project. Could this be the problem?
Comment 5 Tomas Zezula 2011-10-27 15:58:08 UTC
The pure J2SE Project does not create the test folder (as the JUnit may not be installed). It's created on demand when user creates a test. The condition described by Petr prevents the build script to execute testing when there are no tests.
But if the junit is installed it should work fine, I will verify.
Comment 6 Anton Chechel 2011-10-31 14:04:09 UTC
Fixed by not creating "test" dir for FX project by default.
But Tomas, I believe there is still minor issue in J2SE build infrastructure (with junit installed and "test" dir created for new project).

http://hg.netbeans.org/jet-main/rev/497b1eb500d8
Comment 7 Quality Engineering 2011-11-01 15:10:31 UTC
Integrated into 'main-golden'
Changeset: http://hg.netbeans.org/main-golden/rev/497b1eb500d8
User: Anton Chechel <manowar@netbeans.org>
Log: #203051 do not create 'test' dir by default