1

About

I am having a NetBeans project with source code that includes two .jar files that load platform and architecture dependent native libraries each. The following shows the library structure in a generic way:

lib (NetBeans project root level)
  MyLib
    lib1-osx
    lib1-win
    lib2-osx
    lib2-win-x64
    lib1.jar
    lib2.jar

The paths of the native libraries need to be defined in the -Djava.library.path variable. The VM Options field within the Run property of the project properties looks like this for the generic library structure:

-Djava.library.path=
"./lib/MyLib/lib1-win";
"./lib/MyLib/lib1-osx";
"./lib/MyLib/lib2-win-x64";
"./lib/MyLib/lib2-osx";

Problem

The string above only works for Windows because there the entries of -Djava.library.path are separated with ; while OS X needs :.

Question

Is there something like a placeholder where NetBeans inserts the correct separator for each OS? Otherwise I have to provide two different NetBeans projects what is definitely not what I want.

Bee
  • 1,306
  • 2
  • 10
  • 24
  • 1
    **No**. The separator is different between platforms, and there is no place holder to use instead. – Elliott Frisch Dec 23 '16 at 17:07
  • Thanks for your answer! So NetBeans is simply not made for something like "multi-os" projects? – Bee Dec 23 '16 at 17:23
  • 2
    Sure it is. But run-time configuration is not the same as "multi-os" project, run-time configuration is specific to a *run-time*. – Elliott Frisch Dec 23 '16 at 17:30
  • Why would you have OSX library directories in a Windiws library path? – user207421 Dec 23 '16 at 18:03
  • Because I simply wanted to have one VM Option string that can be used on any OS without having to switch the project configuration. Currently it is split up into a Windows and an OS X configuration that only contain paths to the libraries needed. – Bee Dec 23 '16 at 18:05

0 Answers0