Build Problem

JMH

Member
Joined
Sep 9, 2020
Posts
5
Likes
1
Hi All,

I'm new to MotiveWave. I'm trying to compile MotiveWave Studies Examples with the help of the documentation on MAC OSX.

===================
Java Version:
java version "1.8.0_261"
Java(TM) SE Runtime Environment (build 1.8.0_261-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.261-b12, mixed mode)
javac 1.8.0_261

Eclipse Version: 2020-06 (4.16.0)

===================
Error generated:
Buildfile: /Users/jean-marc/Programmation/Eclipse/Workspace_Motivewave/MotiveWave Studies Examples/MotiveWave Studies/build/build.xml
clean:
[delete] Deleting directory /Users/jean-marc/Programmation/Eclipse/Workspace_Motivewave/MotiveWave Studies Examples/MotiveWave Studies/build/classes
compile:
[mkdir] Created dir: /Users/jean-marc/Programmation/Eclipse/Workspace_Motivewave/MotiveWave Studies Examples/MotiveWave Studies/build/classes
[javac] Compiling 6 source files to /Users/jean-marc/Programmation/Eclipse/Workspace_Motivewave/MotiveWave Studies Examples/MotiveWave Studies/build/classes
[javac] /Users/jean-marc/Programmation/Eclipse/Workspace_Motivewave/MotiveWave Studies Examples/MotiveWave Studies/src/study_examples/CompositeSample.java:3: error: cannot access BarSize
[javac] import com.motivewave.platform.sdk.common.BarSize;
[javac] ^
[javac] bad class file: /Users/jean-marc/Programmation/Eclipse/Workspace_Motivewave/MotiveWave Studies Examples/MotiveWave Studies/lib/mwave_sdk.jar(com/motivewave/platform/sdk/common/BarSize.class)
[javac] class file has wrong version 57.0, should be 52.0
[javac] Please remove or make sure it appears in the correct subdirectory of the classpath.
BUILD FAILED
/Users/jean-marc/Programmation/Eclipse/Workspace_Motivewave/MotiveWave Studies Examples/MotiveWave Studies/build/build.xml:46: Compile failed; see the compiler error output for details.
Total time: 887 milliseconds

I don't understand, I use the right version of Java. Do you know which java compiler version was used to compile the the library

394
Any idea?

Thank for your help.
 

Spin

Well-known member
Joined
May 22, 2019
Posts
313
Likes
99
Hello there @JMH and welcome to the MW-forums :)

You seem to do everything correctly, as far as I can see.

I have had compiling issues too in the recent past (with a very similar error-statement) and discovered that MW updated their sdk.jar. So I re-downloaded it from the 'resources' on their site https://www.motivewave.com/support/sdk.htm

Everything runs smoothly here now, with both the old and the new sdk.jar in my 'lib'-folder. I use JavaSE-11

395


EDIT: if you happen to have a hex-editor lying around, you could easily check what version your class was built in:
https://en.wikipedia.org/wiki/Java_class_file#General_layout
This might also help:
https://stackoverflow.com/questions/9170832/list-of-java-class-file-format-major-version-numbers
 

JMH

Member
Joined
Sep 9, 2020
Posts
5
Likes
1
Hello @Spin,

Thank you for your quick answer.

Let's see how the major version numbers map to Java versions:
45 = Java 1.1
46 = Java 1.2
47 = Java 1.3
48 = Java 1.4
49 = Java 5
50 = Java 6
51 = Java 7
52 = Java 8
53 = Java 9
54 = Java 10
55 = Java 11
56 = Java 12
57 = Java 13

Then, it's mean that, in the current version of MotiveWave library, the Java version 13 (57) is used. I need in this case to install JDK 13 (JRE 13). But I read in the document that the minimal Java version used should be 8. This is false!
I will try with the Version 13.
 

JMH

Member
Joined
Sep 9, 2020
Posts
5
Likes
1
The version Java 14 is 58. Version 13 does not exist!
So I downloaded the Version 14. It works fine.
Thanks for help.
 
Last edited:

Spin

Well-known member
Joined
May 22, 2019
Posts
313
Likes
99
Ok, so i looked into the hexadecimal values of my 2019 mwave_sdk.jar and found this for the BarSize.class:
397

The major class version is Java SE 9 = 53 (0x35 hex), so compiling with your original SE8 will not work imo.

For the most recent mwave_sdk.jar (the one on MW's site right now), the hexvalues are
398

so you would at least need Java SE 13 = 57 (0x39 hex), I think.

That version can be downloaded here:
https://www.oracle.com/java/technologies/javase-jdk13-downloads.html

Please verify again :)

PS: inspecting those hexvalues is as simple as extracting a single class from that .jar, and then running "hexdump BarSize.class | less" in a Linux or Mac terminal. Win has something similar, ask Dr. Google
 

JMH

Member
Joined
Sep 9, 2020
Posts
5
Likes
1
Thank You.
I don't need to check Hex Data. During the compiling, this information is generated. As I said, I tested with the Version 14. It works fine.
This is strange because on my Oracle link, i didn't find the version 13.
 

Spin

Well-known member
Joined
May 22, 2019
Posts
313
Likes
99
--- EDIT ---

SOLVED: I took this opportunity to switch to IntelliJ and succeeded in getting everything to work there :)


------------

Ok, I am puzzled now.

I just downloaded the latest 'motivewave_studies.zip' from this location: https://www.motivewave.com/support/sdk.htm

I removed the old .jar from my project's build path and added the one from the .zip file mentioned above.

I get a bunch of errors when building:

474

I have tried:
  • Project - clean
  • Project - refresh
  • restarting Eclipse
  • removing the .jar and re-adding it, both in the ModulePath and in the ClassPath
I have checked one of the classes in the latest .jar in a hexeditor and it has version 39 (which stands for Java SE13, as noted in previous posts in this thread)


475

I have not changed my JAVA-version since downloading the latest SDK-file from MW (it was set to JAVA SE13 before, and all compilations worked without a glitch)

I am out of inspiration here. Is there a remote possibility that the latest .jar was badly compiled ?
Anything else I might have missed ?
:unsure:
 
Last edited:

jpark

New member
Joined
Nov 14, 2020
Posts
2
Likes
1
Fwiw, I can confirm that I just downloaded that latest 'motivewave_studies.zip' file and it worked on my end. New to this project, so I might not be of too much more help than that, i'm afraid :/
 

sas7085

Active member
Joined
Jul 7, 2020
Posts
28
Likes
6
I have changed the java version and landed into one issue. I am able to build the eclipse project and the class files / jar is being copied to Motive Wave extension folder but i am not able the see the Example folder in Strategies.

Ant Log :
Buildfile: /home/sam/git/motivewave/MotiveWaveStudies/MotiveWave Studies/build/build.xml
clean:
[delete] Deleting directory /home/sam/git/motivewave/MotiveWaveStudies/MotiveWave Studies/build/classes
[delete] Deleting directory /home/sam/git/motivewave/MotiveWaveStudies/MotiveWave Studies/build/jar
compile:
[mkdir] Created dir: /home/sam/git/motivewave/MotiveWaveStudies/MotiveWave Studies/build/classes
[javac] Compiling 12 source files to /home/sam/git/motivewave/MotiveWaveStudies/MotiveWave Studies/build/classes
deploy:
[delete] Deleting directory /home/sam/MotiveWave Extensions/dev
[mkdir] Created dir: /home/sam/MotiveWave Extensions/dev
[copy] Copying 24 files to /home/sam/MotiveWave Extensions/dev
BUILD SUCCESSFUL
Total time: 1 second

I am using Java 17 and downgraded to 13 to test but no lock. Earlier using java 11 and it was working.
My Motive wave version is old one 6.5.2.

1654992192381.png
 
Top