Skip to content

Problem using Java with Ant projects #7244

@NttCAD

Description

@NttCAD

Apache NetBeans version

Apache NetBeans 21

What happened

  1. Use NetBeans 20 (21 doesn't work)

  2. Create new java with Ant library class project, and create the class Jlib:

package jlib;

public class Jlib {

public void printMessage() {
	System.out.print("Ciao!");
}

}

  1. Create new Java applicationant project with a Main Class:

package japp;

import jlib.Jlib;

public class Japp {

public static void main(String[] args) {
	Jlib jlib = new Jlib();
	jlib.printMessage();
}

}

  1. Right click property of Japp and add Jlib to the Classpath

  2. Compile the projects and run.

Language / Project Type / NetBeans Component

Java application and library with Ant

How to reproduce

  1. This is what I see into the output window:

run:
Exception in thread "main" java.lang.RuntimeException: Uncompilable code - cannot find symbol
symbol: class Jlib
location: class japp.Japp
at japp.Japp.main(Japp.java:1)
/home/luca/.cache/netbeans/20/executor-snippets/run.xml:111: The following error occurred while executing this line:
/home/luca/.cache/netbeans/20/executor-snippets/run.xml:68: Java returned: 1
BUILD FAILED (total time: 2 seconds)

  1. Also the editor does not see Jlib.

Did this work correctly in an earlier version?

Apache NetBeans 16 or earlier

Operating System

Ubunt 22.04

JDK

JDK 21

Apache NetBeans packaging

Apache NetBeans binary zip

Anything else

No response

Are you willing to submit a pull request?

No

Metadata

Metadata

Assignees

No one assigned

    Labels

    Ant[ci] enable "build tools" testskind:bugBug report or fixneeds:triageRequires attention from one of the committers

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions