Luis Afonso Teixeira
Luis Afonso Teixeira

Reputation: 211

How to edit library source files on NetBeans?

I am doing JAVA project based on the SSJ (Stochastic Simulation in Java) libraries. In my project I have followed the required steps to import the SSJ library files and also the source files.

When looking at the SSJ library files in the project's Libraries branch, only class files appear shown, but when I open them I can view the source code (which I couldn't before, as I hadn't imported the sources) so I assume everything was imported correctly.

When I run the examples provided with the library everything runs fine and as expected. But if I try to change the source code for the libraries for instance, changing the text on an output, the changes I make to the source files aren't reflected in the output from the java programs.

Any hint on what I might be doing wrong?

I understand this might be hard to understand or test as I can't quite create and SSCCE for this matter. The library files are hosted here (http://www.iro.umontreal.ca/~simardr/ssj/ssj-20120216.zip) and the source code here (http://www.iro.umontreal.ca/~simardr/ssj/ssj-source.html).

Thanks in advance for all your help!

Upvotes: 3

Views: 4480

Answers (2)

R. Simard
R. Simard

Reputation: 1

In order to create the new *.java file from the *.tex file, you need the tcode.jar which is available in the distribution. Have you added tcode.jar as an external jar to your project?

umontreal.iro.lecuyer.tcode.Texjava is in tcode.jar

Upvotes: 0

madth3
madth3

Reputation: 7344

Adding source to libraries it's for debugging and documentation purposes. It does not mean that Netbeans will detect changes and recompile classes automatically.

You should create a project for the library itself to recreate it from source. Changes are that if you have the source there will be a build.xmlor a pom.xml that contains the steps to compile the library and will allow to create a Java Free Form Project or a Project with existing POM.

You'd then remove the reference to library itself and add a dependency to the project.

Other option would be to add the library source to the same project you are using (and, again, removing reference to the library) but I would not recommend this unless it's a very small simple library.

EDIT. Particular ssj information.

ssj is a library where the original source code is in .tex files and it requires several programs available to generate .java files and then compile them. All this information can be found in the COMPILE.txt original file.

Since the source distribution includes .java files it is possible to generate a .jar just using Netbeans but it requires to modify the build.xml to just compile Java source files. Also when creating the Java Free Form Project is necessary to select lib as the target to Build Project.

Here it's a minimal build xml for Netbeans 7.1 to compile from Java sources.

Upvotes: 3

Related Questions