Welcome Guest,Register Now
Log In

ANT Forum

Welcome guest, please Login or Register

   

Unable to create Java libraries using FitGen

Rank

Total Posts: 25

Joined 2016-08-16

PM

I'm trying to use FitGen.exe to create a new profile, but that is failing so I tried to run FitGen.exe immediately after unpacking FitSDKRelease_20.14.00.zip.

I'm using JDK 8 u111, Windows 8.1, latest security updates.

The output of FitGen.exe is fine for c, cpp, and C#, but not for Java:
FIT Code Generator Protocol 2.00  Profile 20.14Release
SDK Version
production/akw/20.14.00-0-g448ef52
Parsing existing config
.csv...
Writing new config.csv...
Generating C code...
Generating C code for EXAMPLE...
Generating C++ code...
Generating C# code...
Generating Fit.dll...
Fit.dll generation statusSuccess
Fit
.dll generation statusFailure
Generating Java code
...
Building Java tools...0%

....

com\garmin\fit\Decode.java:222warning[overloads] addListener(MesgListeneri
n Decode is potentially ambiguous with addListener
(MesgDefinitionListenerin De
code
   
public void addListener(MesgListener mesgListener{
               
^
83 warnings
Picked up _JAVA_OPTIONS
: -Djava.net.preferIPv4Stack=true

7
%
com\garmin\fit\csv\MesgFilter.java:42warning[overloads] addListener(MesgList
ener
in MesgFilter is potentially ambiguous with addListener(MesgDefinitionList
ener
in MesgFilter
   
public void addListener(MesgListener mesgListener{
               
^
1 warning
Picked up _JAVA_OPTIONS
: -Djava.net.preferIPv4Stack=true
14
%
Picked up _JAVA_OPTIONS: -Djava.net.preferIPv4Stack=true
21
%
Picked up _JAVA_OPTIONS: -Djava.net.preferIPv4Stack=true
28
%
Picked up _JAVA_OPTIONS: -Djava.net.preferIPv4Stack=true
35
%
Picked up _JAVA_OPTIONS: -Djava.net.preferIPv4Stack=true
42
Errors present in Java codeaborting Java compilation
ERROR writing Java code


Suggestions?      
RankRank

Total Posts: 34

Joined 2013-01-28

PM

Hello,

Unfortunately we only support generating a jar using Java 6 at this time. Please try pulling down a Java 6 JDK and try to compile it using that.

-Evan      
Rank

Total Posts: 25

Joined 2016-08-16

PM

Ah, I thought I had read to use the latest JDK.
Now to find a Java 6 JDK....      
Rank

Total Posts: 25

Joined 2016-08-16

PM

Okay, I installed JDK 6.0_45. Same error. What other explanations are possible?

Is there any way to get more information that can help diagnose the problem?      
RankRank

Total Posts: 34

Joined 2013-01-28

PM

Hello, it is likely still calling your Java 8 JDK. Can you add Java 6 to your path?

-Evan      
Rank

Total Posts: 25

Joined 2016-08-16

PM

I did add Java 6 to my path. I removed Java 8 from the VM (Windows 8.1). I modified the PATH variable right before calling FitGen.exe. And I ran FitGen.exe from a newly downloaded, newly unzipped, FitSDKRelease_20.14.00.zip

Here is a bit of cmd.exe information:
C:\FitSDKRelease_20.14.00>where.exe java.exe
C
:\Windows\System32\java.exe
C
:\Program Files\Java\jdk1.6.0_45\bin\java.exe

C
:\FitSDKRelease_20.14.00>where.exe java*
C:\Windows\System32\java.exe
C
:\Windows\System32\JavaScriptCollectionAgent.dll
C
:\Windows\System32\javaw.exe
C
:\Windows\System32\javaws.exe
C
:\Program Files\Java\jdk1.6.0_45\bin\java-rmi.exe
C
:\Program Files\Java\jdk1.6.0_45\bin\java.exe
C
:\Program Files\Java\jdk1.6.0_45\bin\javac.exe
C
:\Program Files\Java\jdk1.6.0_45\bin\javadoc.exe
C
:\Program Files\Java\jdk1.6.0_45\bin\javah.exe
C
:\Program Files\Java\jdk1.6.0_45\bin\javap.exe
C
:\Program Files\Java\jdk1.6.0_45\bin\javaw.exe
C
:\Program Files\Java\jdk1.6.0_45\bin\javaws.exe

C
:\FitSDKRelease_20.14.00>javac -version
Picked up _JAVA_OPTIONS
: -Djava.net.preferIPv4Stack=true
javac 1.6.0_45

C
:\FitSDKRelease_20.14.00>echo %PATH%
C:\Perl\site\bin;C:\Perl\bin;C:\Program Files (x86)\Parallels\Parallels Tools\Ap
plications
;C:\windows\system32;C:\windows;C:\windows\System32\Wbem;C:\windows\Sy
stem32\WindowsPowerShell\v1.0\
;C:\Program Files\Microsoft SQL Server\120\Tools\B
inn\
;C:\Program Files (x86)\Windows Kits\10\Windows Performance Toolkit\;C:\Prog
ram Files\Microsoft SQL Server\110\Tools\Binn\
;C:\Program Files\CMake\bin;C:\Pro
gram Files\Java\jdk1.6.0_45\bin 
     
Rank

Total Posts: 25

Joined 2016-08-16

PM

So, is there anyway to get more information from FitGen.exe? Can I send you a zip file of the java directory that FitGen.exe creates to help you determine where the error is occurring beyond the 42%?      
RankRankRank

Total Posts: 68

Joined 0

PM

After Switching SDKs do you still see:

com\garmin\fit\Decode.java:222warning[overloads] addListener(MesgListeneri
n Decode is potentially ambiguous with addListener
(MesgDefinitionListenerin De
code
   
public void addListener(MesgListener mesgListener{
               
^
83 warnings
Picked up _JAVA_OPTIONS
: -Djava.net.preferIPv4Stack=true 


or has the error reduced to just:
Picked up _JAVA_OPTIONS: -Djava.net.preferIPv4Stack=true
14
%
Picked up _JAVA_OPTIONS: -Djava.net.preferIPv4Stack=true
21
%
Picked up _JAVA_OPTIONS: -Djava.net.preferIPv4Stack=true
28
%
Picked up _JAVA_OPTIONS: -Djava.net.preferIPv4Stack=true
35
%
Picked up _JAVA_OPTIONS: -Djava.net.preferIPv4Stack=true
42
Errors present in Java codeaborting Java compilation
ERROR writing Java code


If you remove the _JAVA_OPTIONS environment variable does the build work?
     
Rank

Total Posts: 7

Joined 2012-11-15

PM

I just ran into this today as well. Additional hint: Use 32-bit version of jdk 6.
     
Rank

Total Posts: 25

Joined 2016-08-16

PM

Okay, now I'm trying Java 6u45 for x86:

C:\FitSDKRelease_20.14.00>where javac
C
:\Program Files (x86)\Java\jdk1.6.0_45\bin\javac.exe

C
:\FitSDKRelease_20.14.00>echo %PATH%
C:\Perl\site\bin;C:\Perl\bin;C:\Program Files (x86)\Parallels\Parallels Tools\Ap
plications
;C:\windows\system32;C:\windows;C:\windows\System32\Wbem;C:\windows\Sy
stem32\WindowsPowerShell\v1.0\
;C:\Program Files\Microsoft SQL Server\120\Tools\B
inn\
;C:\Program Files (x86)\Windows Kits\10\Windows Performance Toolkit\;C:\Prog
ram Files\Microsoft SQL Server\110\Tools\Binn\
;C:\Program Files\CMake\bin;C:\Pro
gram Files 
(x86)\Java\jdk1.6.0_45\bin 


C:\FitSDKRelease_20.14.00>FitGen.exe -java java
FIT Code Generator 
Protocol 2.00  Profile 20.14Release
SDK Version
production/akw/20.14.00-0-g448ef52
Parsing existing config
.csv...
Writing new config.csv...
Generating Java code...
Building Java tools...0%
Picked up _JAVA_OPTIONS: -Djava.net.preferIPv4Stack=true

7
%
Picked up _JAVA_OPTIONS: -Djava.net.preferIPv4Stack=true

14
%
Picked up _JAVA_OPTIONS: -Djava.net.preferIPv4Stack=true

21
%
Picked up _JAVA_OPTIONS: -Djava.net.preferIPv4Stack=true

28
%
Picked up _JAVA_OPTIONS: -Djava.net.preferIPv4Stack=true

35
%
Picked up _JAVA_OPTIONS: -Djava.net.preferIPv4Stack=true

42
Errors present in Java codeaborting Java compilation
ERROR writing Java code
     
RankRankRank

Total Posts: 68

Joined 0

PM

Looks like your _JAVA_OPTIONS variable is still set.      
Rank

Total Posts: 25

Joined 2016-08-16

PM

Ah, that seems to have been an issue:

c:\FitSDKRelease_20.14.00>echo %_JAVA_OPTIONS%
-
Djava.net.preferIPv4Stack=true

c
:\FitSDKRelease_20.14.00>set _JAVA_OPTIONS=

c:\FitSDKRelease_20.14.00>FitGen.exe -java java
FIT Code Generator 
Protocol 2.00  Profile 20.14Release
SDK Version
production/akw/20.14.00-0-g448ef52
Parsing existing config
.csv...
Writing new config.csv...
Generating Java code...
Building Java tools...100


So, can the documentation please be updated?
- Windows
- Java JDK 6 32bit
- no _JAVA_OPTIONS

And/or can a issue be created to track this problem?

Thanks for your help!      
RankRankRank

Total Posts: 68

Joined 0

PM

We have released a new version of the SDK which addresses this issue.