This Community site is new! Please help us build a community around the JNIOR.
Sign up, and help share your knowledge. Please sign-up even if you do not plan to post as a sign of support.
If there is evidence of a demand we will continue to develop the content here.

Configuring Netbeans for JANOS Runtime

You got ideas? Let's hear 'em. Here we can talk about your experiences programming on the JNIOR or items that you may wish to have INTEG assist you with.
Post Reply
Posts: 401
Joined: Thu Sep 14, 2017 12:55 pm

Configuring Netbeans for JANOS Runtime

Post by bscloutier » Mon Nov 20, 2017 9:33 am

I have described how to configure Netbeans for the JNIOR many times. The most recent was here viewtopic.php?f=5&t=158#p287 in a topic where we develop the interface for an HMI device. There I describe how you right-click on the Netbeans project and make entries in the Project Properties dialog. Unfortunately there is one change that you need to make that is not accommodated by the dialog.

We have not yet created a way to automate this configuration for you. It would be nice for instance if we could create a "platform" for the JNIOR. While that might be possible in some sophisticated way it is much more elaborate that we need. It is certainly not a simple or common task. Instead I would like to describe the file. it would be a simple matter to create a program to edit this text file and thereby properly configure a project for the JANOS Runtime environment. You can manually edit this file either from within Netbeans or with an external text editor.

The file for any project is located in the project folder under nbproject. So for that HMI project for instance the file has a path something like this: ../NetbeansProjects/Hmi/nbproject/ The file is easy to find. You can even use Netbeans' Files Window (Ctrl+2). This properties file is a text file containing name-value pairs formatted as assignments. It also accommodates comment lines beginning with the '#'. At some point not long ago that symbol went from begin a "pound sign" to a "hashtag". And... you argue that you aren't being brain-washed? :?

Here are the entries in the file that affect us. Note that the asterisk '*' here is a wildcard.
  • file.reference.*
  • javac.classpath
  • javadoc.reference.*
  • source.reference.*
  • javac.compilerargs
  • endorsed.classpath
The last in the list is the one that you cannot alter through the standard Properties dialog.

So to configure a project you need the /etc/JanosClasses.jar file which you can download from the Series 4 JNIOR. But that file is embedded in the JNIOR and excludes JavaDoc and Source detail because space is constrained there. You can also use a runtime JAR obtained from INTEG that has the additional detail. For JANOS v1.6.3 this file is called JanosRuntime_1.6.3.jar.

Now in addition to the file name we will need an absolute path to it. So if you put JanosRuntime_1.6.3.jar in the NetBeansProjects folder you end with a path like this: C:\\Users\\Bruce\\Documents\\NetBeansProjects\\JanosRuntime_1.6.3.jar. Well close to that unless your username is also "Bruce".

One other thing to note is that project properties can refer to other properties using the syntax that will be evident in a moment. You probably should avoid creating a circular reference. We wouldn't want to prematurely destroy the Internet.

So the above properties should all end up once they are correctly set as follows. Note that the '\' at the end of a line is an optional line continuation if you happen to see it. Also the '!' exclamation point means concatenation.
  • file.reference.JanosRuntime_1.6.3.jar=C:\\Users\\Bruce\\Documents\\NetBeansProjects\\JanosRuntime_1.6.3.jar
  • javac.classpath=${file.reference.JanosRuntime_1.6.3.jar}
  • javadoc.reference.JanosRuntime_1.6.3.jar=${file.reference.JanosRuntime_1.6.3.jar}!/javadoc/
  • source.reference.JanosRuntime_1.6.3.jar=${file.reference.JanosRuntime_1.6.3.jar}!/src/
  • javac.compilerargs=-bootclasspath "${javac.classpath}"
  • endorsed.classpath=${javac.classpath}
In our case there must be only one file.reference, javadoc.reference and source.reference entry. Those referencing our JAR. If there are others they must be removed.

So you can see that you could write a simple C or Java program to open this file and make the changes. Something to think about. But it is easy to adjust manually. A project configured this way (however you get there) will build programs targeted to run under JANOS and the IDE will even be helpful. So give it a try! :)

Post Reply