NetBeans 10: missing external libraries in dist/lib - netbeans

I used to work with NetBeans 8 and when I used to "clean and build" my project, NetBeans used to put MyProject.jar in the directory dist/, and ALL the external libraries and projects in dist/lib/.
But recently, I've installed NetBeans 10 and after a "clean and build" only the file MyProject.jar is in dist/. I've found many discussions/blogs/etc. online to create a single jar file with all the external librairies inside, but it's not what I need.
How can I do that?

I found out that the file nbproject/build-impl.xml was really different. Hopefully, I still had this file from my former NetBeans 8 version and I replaced the new file by the old one and it works.
If someone has a better solution/explanation, I still take it.

Related

Define a Java 9 multi-moduled project in Eclipse

I'm trying out Java 9 Jigsaw module system (no module experience yet) and would like to use it for capsuling the classes within my project, but it's confusing.
According to this article it should be possible to have multiple modules within ONE project. I made a new project in Eclipse Oxygen (Java 9 is supported) with the same structure as shown in the article. But Eclipse keeps telling me that I must not have more than one module-info.java in a project.
I really don't know how to tell Eclipse that it should use the "multi-module-mode". And I really would appreciate not having to create a new project for every single module.
This works:
This not:
But according to this article something like that should work:
And how about deployment of a modularized project with Eclipse? There is nothing to see about the new jmod extension. Do I still export it as a runnable JAR file like before?
Notice that my questions refer to working with the IDE (no command line, I mean with an IDE that should be possible, right?) Thank you for enlightening me.
Currently, Eclipse requires you to create a separate project for each module (e. g. because each module has its own Java Build Path).
To understand this design decision, consider that Java modules correspond to OSGi bundles / Eclipse plug-ins and it has always been to have a separate project for each bundle/plug-in. If you come from the Maven world, you would probably expect a deeper folder structure instead. But modules are self-contained and combining several modules into one project would only add an additional folder level without meaning. However, Eclipse supports nested projects and so-called working sets if you need an additional folder level.
Exporting modules as images is planned for Eclipse 2019-03 (4.11), on March 20, 2019 (see Eclipse bug 518445). Exporting modules as JARs that can be used on the modulepath (-m) already works (see my video).
I don't know if this question is still open for an answer, but you can solve this problem by simply removing all source folders on the build path. At least this works for Eclipse 2021-12 version.
As you can see this is a demo project from the Official Gradle Guide Book and it has multiple modules. Each module has its own module-info.java.
project structure in IntelliJ IDEA
If I open this project in Eclipse it will give me the 'duplicated entries on module-info.java' error.
Eclipse shows the error
But if I delete all the source folders on the build path, the error is gone and the project can be built and run without problem.
project properties: Java build path
The only problem is that you have to build the project with Gradle so that it will produce the .jar of each module and you have to include them in the libraries later.
include all the .jar in libraries
I think this is probably the same solution mentioned by howlger above.

Trying to use Eclipse (Mars) with Linked Folders for ESP8266 project

I have successfully built a number of projects with eclipse (mars) under windows 10 with copied common source and header files. I now want to refactor these projects to use the eclipse 'linked folder' facility.
linked folders
I have successfully created the common project and the linked source folders to it in the target project.
However when I try to compile the project the compiler can't see the linked folders...
compiler error messages
I'd appreciate any help with this, or is it that the xtensa compiler under windows doesn't support linked folders??
IMHO "linked folders" is a slightly borked feature as it raises expectations it can't fulfill. The folders are only linked within the Eclipse context. That means that as soon as you leave the safe Eclipse haven those links are gone.
What you actually want/need are links on OS level that also work on the command line i.e. you need them on the file system. Such symlinks are native on Unix(-like) systems but there are ways to create them on Windows as well.

Eclipse not exporting libraries

(In Eclipse) When I right click export and export as a Jar file, it does not package the libraries into the Jar file. It was exporting the libraries a couple weeks ago and the libraries were going into the Jar file and I'm not sure what changed.
I figured it was Eclipse so I reinstalled the program and imported the workspace with no luck. I also tried on a completely different machine.
I've moved the libraries into a container in Eclipse and also tried external libraries and none of the libraries are exporting. The only thing it's exporting is the class files, .claspath, .project, and the manifest.
Any suggestions would be greatly appreciated!
Of course when you post a question you've been working on (for hours) you seem to find the answer 5 minutes later...
The file was not exporting correctly because I chose "JAR file" instead of "Runnable JAR File".

Generate Jar in netbeans 7.1

I am using netbeans 7.1 (new to it). I would like to know how to export our projects as a .jar file (though I have searched a lot in Internet).
Many times ./dist folder itself is not created, even though it is created, I see only .zip files (not jar). It would be great if one can help me out in this aspect. Seems like in earlier version of netbeans, the jar would be available in ./dist folder.
Do this before search :) (right click the project > Clean and Build)
When you use the Clean and Build command, the IDE runs a build script that performs the following tasks:
Deletes any previously compiled files and other build outputs.
Recompiles the application and builds a JAR file containing the compiled files.
There is no difference in Netbeans 7.1, the jar will be in the dist folder :)

how to setup the sphinx with netbeans

i have successfully configured sphinx4 with eclipse.
for that these steps i have used.
copy my java and config files to SRC folder
all the necessary jar files (in the lib). the lib folder added to the root of the project
build those jar files (jsapi files too)
change the configuration file and give the proper path
test the java file
but in Netbeans i really dont understand how to do the proper steps. can someone help me. the jar files should be added to "Libraries" rite.
then after adding them how to build them.
in the netbeans it dont show a SRC folder. so all the java files and configuration files should go to Source Packages folder rite.
can someone help me with this. please
If you have sphinx4-1.0beta6 then you can just open the folder up as a netbeans project. Open netbeans, click open project, then navigate to the sphinx folder and open it. It is already a netbeans project file type as of this version. I assume this will work in later versions also. I have no clue why sphinx doesn't say this on their website.
Sphinx4 is a Java library available in OSS repository, so you can use it as any library.
If your project uses maven/gradle, add repository in your project configuration, then add dependency on two packages - sphinx4 core and sphinx4-data. The former is the main library, the latter is required if you want to recognize US English. Then just start writing the code.
If you want to rely on jar files, just download sphinx4-core and sphinx4-data files from the repository and add them as dependency to the project, then start writing code.
If you want to modify or develop sphinx4 itself, install Gradle support in your IDE, then import latest sphinx4 sources as a Gradle project.
For more details and links see the tutorial
http://cmusphinx.sourceforge.net/wiki/tutorialsphinx4
click on Add JAR/Folder
select jar file you want to add