0

I've got a build.xml script that builds my Java application on MacOs just fine.

On Windows it fails with:

Exception: java.io.FileNotFoundException: E:\ogamp-all-platforms-v2.2.4\jar\gluegen-rt-android-natives-android-armv6.jar (The system cannot find the file specified)

Note missing first character on the after 'E:\'.

The error seems to come from this definition:

 <fx:resources id="appRes">
        <fx:fileset dir="build" includes="EazyCNC.jar" />
        <fx:fileset dir="lib" />
        <fx:fileset dir="." includes="jogamp-all-platforms-v2.2.4/jar/*.jar" />
      </fx:resources>

I'm at loss what could be wrong, tried all short of hacks and guess for example if I prepend the path with 'xxx' then for some reason I do not get the error and the build succeeds but the jogamp libries are not included in the .exe and the app fails at the point in code where it first accesses those libs.

This is with Eclipse 4.8.0 and JDK 1.8.0_181 and Inno Setup 5.6.1

EDIT, further info:

If I change the name of the file mentioned in the error message ("gluegen-rt-android-natives-android-armv6.jar") then that change is reflected in the error message! Note that the file itself is not directly mentioned in the build script, only the parent dir. So my conclusion is that the ant correctly constructs the fileset but some other part of the build process fails to open the file, perhaps incorrectly reporting the file path.

Or could this be related to the fact that this is all happening in a VirtualBox and I've mapped the project folder from MacOs host to Windows E: drive letter so it would appear as the path starts from the 'root' directory of that drive...

nyholku
  • 456
  • 3
  • 15

2 Answers2

0

Windows use backslash for paths.Try replacing '/' with '\'.

This should work:

"jogamp-all-platforms-v2.2.4\jar*.jar"

Also check if you escape characters correctly

Escaping File Paths in Scripts

BlueWookie
  • 55
  • 1
  • 3
  • 12
  • Thanks, tried that, replaces every '/' with '\\' but the in the error message the path is still missing the first character though otherwise it looks correct. BTW the backslash appeared correctly in the path reported in the error message even before this change; I was under the impression that it is ok to use *nix paths in ant scripts even on Windows. – nyholku Sep 09 '18 at 12:29
  • Then maybe try writing the full path instead of a relative one. – BlueWookie Sep 09 '18 at 14:17
0

Solved it!

It appears that something in the javapackager deploy task goes wrong if the resource fileset refers to a directory that is the root of a Windows disk.

By changing my folder sharing from MacOs (and drive mapping) so that the drive letter does NOT refer to the project folder of my project (which is shared from the MacOs) but instead refers to the parent of the project folder everything now works.

In other words, previously in my ant script '.' referred, when fully resolved, to the drive 'E:', but now '.', when fully resolved, refers to 'E:\EazyCNC-Project'.

I don't know if this is javapackager issue or perhaps Inno Setup problem.

Not a big deal if you know it.

nyholku
  • 456
  • 3
  • 15