Replies: 27 comments 1 reply
-
I can't reproduce this on NB 21 (Windows) and JDK21. If you want to add a dependency on JLib to JApp, the best way is to right click on the Libraries of JApp and add JLib as a project, then NB will handle setting the classpath for you. But I tried just adding the jar directly to the classpath and that was OK too. Does the jar for JLib definitely contain the classes you expect it to? |
Beta Was this translation helpful? Give feedback.
-
Tried again on NB 21(Ubuntu) ... doesn't work for me |
Beta Was this translation helpful? Give feedback.
-
Do you have the log eventually ? |
Beta Was this translation helpful? Give feedback.
-
I made a zip with 2 projects (nttjapp and nttjlib) in it. You can use it with
|
Beta Was this translation helpful? Give feedback.
-
Your project works! But if I create this project with my NB 21 on my Linux Ubuntu, it doesn't work. |
Beta Was this translation helpful? Give feedback.
-
So the build is succesful but editor signal errors. |
Beta Was this translation helpful? Give feedback.
-
In my opinion you should try tu create the projects on Ubuntu. |
Beta Was this translation helpful? Give feedback.
-
I'm on Ubuntu 23.10, with Amazon Corretto 21 and this is not reproducible. Edit: not even removing all intermediately created BUT: @NttCAD did you add the library to the module- or to the classpath? |
Beta Was this translation helpful? Give feedback.
-
Maybe you don't belive me, but YES |
Beta Was this translation helpful? Give feedback.
-
@NttCAD please check my comment again. Before you answered I had already checked, that compilation of the projects does not change anything. But if you added the library project to the module path of the application project and not to the classpath of the project, then I can reproduce your observation. |
Beta Was this translation helpful? Give feedback.
-
Into the "projet properties" window of my java ant application, "Compile" tab, I added my java library projet to the "Classpath"; not "Module" (I don't use any module). I'm using NB 21, downloaded Binaries (Platform Independent) on ubuntu linux. |
Beta Was this translation helpful? Give feedback.
-
@NttCAD then please provide the projects that you tested with as ZIP. Maybe that can sched some light on the difference. |
Beta Was this translation helpful? Give feedback.
-
OK. I'ill try... Thank you. |
Beta Was this translation helpful? Give feedback.
-
provided zip file and some screenshot |
Beta Was this translation helpful? Give feedback.
-
I see filenames with '!' in them, e.g. |
Beta Was this translation helpful? Give feedback.
-
Incredible... changing folder name it works!! Created dir: /dati/test/Japp/dist run: |
Beta Was this translation helpful? Give feedback.
-
Good catch @pedro-w - I assume this is caused somewhere by a conflict with use of |
Beta Was this translation helpful? Give feedback.
-
I think it ought to be fixed if it can be. Probably a not high priority though, I can't remember having seen '!' as a path before - but it is perfectly valid, also in Windows. Has anyone any idea how easy this would be to fix? |
Beta Was this translation helpful? Give feedback.
-
Well, first need to work out if my assumption is correct, and if so where the URL is coming from. It probably requires the file part of the JAR URL to have the |
Beta Was this translation helpful? Give feedback.
-
A smoking gun perhaps Neil? I can confirm that this also affects Windows and Mac (i.e. having projects in a subdirectory of |
Beta Was this translation helpful? Give feedback.
-
But I don't understand: this bug is into NetBeans or into JDK? Because I'm using java.util.ResourceBundle class from inside a Jar file, ang I had java.util.MissingResourceException. Now I need to rename the folder "!" and works. ant -f /dati/!/prjs/nttcad/ant.xml "run cad" |
Beta Was this translation helpful? Give feedback.
-
I think this may be unrelated, but that's only a guess without seeing more code.
That name should be a class name, not a path, so it should look more like This might be better on the mailing list, have you subscribed to it? The issue you reported at the top is a bug in NB, I believe, the the JDK itself does not have a problem with |
Beta Was this translation helpful? Give feedback.
-
Or GitHub discussions, which we can migrate issues to. Am going to migrate this. I think there might be an issue to narrow down from this discussion - feel free to open one that's more targeted once we're clearer where the bug is, and whether it's even in NetBeans. |
Beta Was this translation helpful? Give feedback.
-
I provide you a simple project to test java.util.ResourceBundle. But from the command line, I se the exception: luca@luca-J4125NHU:/dati/!/prjs/rb/dist$ /opt/jdk-21.0.2/bin/java -jar rb.jar Obviously, if I rename the folder "!", it works. luca@luca-J4125NHU:/dati/test/rb/dist$ /opt/jdk-21.0.2/bin/java -jar rb.jar |
Beta Was this translation helpful? Give feedback.
-
Ciao! |
Beta Was this translation helpful? Give feedback.
-
Well, this is vary confusing. |
Beta Was this translation helpful? Give feedback.
-
Apache NetBeans version
Apache NetBeans 21
What happened
Use NetBeans 20 (21 doesn't work)
Create new java with Ant library class project, and create the class Jlib:
package jlib;
public class Jlib {
}
package japp;
import jlib.Jlib;
public class Japp {
}
Right click property of Japp and add Jlib to the Classpath
Compile the projects and run.
Language / Project Type / NetBeans Component
Java application and library with Ant
How to reproduce
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)
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
Beta Was this translation helpful? Give feedback.
All reactions