gazbert / bxbot

A simple Bitcoin trading bot written in Java.
MIT License
824 stars 280 forks source link

Add Java 10 Support #80

Closed kgonia closed 6 years ago

kgonia commented 6 years ago

Project fails co run under java9. I found out that it's connect to java9 following changes:

http://mail.openjdk.java.net/pipermail/jdk9-dev/2016-May/004309.html

One of the solutions is adding --add-modules option but it's not recommended and make building project more annoyoing.

https://docs.oracle.com/javase/9/migrate/#GUID-F640FA9D-FB66-4D85-AD2B-D931174C09A3

My proposal is add dependencies to maven/gradle. I already make pull request. https://github.com/gazbert/bxbot/pull/79 It works for java8&9

gazbert commented 6 years ago

Thanks for this @KrzychuJedi

I've not had time to migrate the bot to Java 9 yet - there's already a bxbot-java9 branch that I planned on getting things working on - but it looks like you've done it for me. Thanks!

Does the bot run ok on Java 9 too?

We'll also need to update:

If all is well, we should look to getting a Java 9 compatible release out later this month.

kgonia commented 6 years ago

I build project using java9 unintentionally but when I found problem I'd fix it ;)

After my changes bot run and works (on example config) but I discover that integration tests fails under java9.

bxbot-java9 branch was merged to master so I thought that bot is java9 ready.

So, my proposition is to close this pull request https://github.com/gazbert/bxbot/pull/79 without merge and I will make new one to bxbot-java9 branch. Java9 branch, as you wrote, need some updates and I'm not an expert in java9 ;)

gazbert commented 6 years ago

Sounds like a plan. I've just rebased the Java9 branch and tweaked the Travis link.

I'll merge your new PR when you're ready.

We can get stuff sorted on this branch and merge back to master for a Java9 release later this month all being well.

gazbert commented 6 years ago

https://docs.oracle.com/javase/9/migrate/toc.htm#JSMIG-GUID-7744EF96-5899-4FB2-B34E-86D49B2E89B6

kgonia commented 6 years ago

I'd made pull request to java9 branch https://github.com/gazbert/bxbot/pull/82

mikehfauzy commented 6 years ago

Powermock issue #864 [1] is blocking with no estimate for completion. Apparently, there is a wonky workaround [2], but at this point, I recommend waiting for them to deal and keeping bxbot's support at 1.8 for now.

Once powermock fixes their issue, this is where, in the bxbot to update the dependencies: bxbot-parent/build.gradle powermock_junit: dependencies.create("org.powermock:powermock-module-junit4:2.0.0-beta.5"), powermock_api_easymock: dependencies.create("org.powermock:powermock-api-easymock:2.0.0-beta.5"),

References: [1] Powermock issue #864 powermock/powermock#864

[2] Quoting Workaround: This could be hotfixed by passing --add-opens java.xml/jdk.xml.internal=ALL-UNNAMED

[3] Duplicate issue gazbert/bxbot/issues/87

gazbert commented 6 years ago

Changed branch to bxbot-java10 - JDK 10 superseded JDK 9 on 20 March 2018.

Migration path from JDK 8 -> JDK 10: https://docs.oracle.com/javase/10/migrate/toc.htm#JSMIG-GUID-7744EF96-5899-4FB2-B34E-86D49B2E89B6

gazbert commented 6 years ago

Waiting on Travis JDK 10 support: https://github.com/travis-ci/travis-ci/issues/9368

gazbert commented 6 years ago
  1. Bot now builds with maven and gradle on Oracle JDK 10 - all tests (incl. IT) passing.
  2. Bot runs on Oracle JDK 10.

TODO:

  1. Confirm bot builds and runs on OpenJDK 10.
  2. README updates for using JDK 10 support: the 0.10.x releases will only support JDK 10 going forwards, but the 0.8.x + 0.9.x release streams will continue to support JDK 8 (maintenance mode only - no new features will be added) until end of life Jan 2019.
  3. Test Travis JDK 10 support when available.
  4. Test Docker build works openjdk 10.
gazbert commented 6 years ago

One warning on startup:

hostname:~/dev/IdeaProjects/bxbot/target/bxbot-parent-0.10.0-SNAPSHOT$ tail -f WARNING: An illegal reflective access operation has occurred WARNING: Illegal reflective access by org.springframework.cglib.core.ReflectUtils$1 (jar:file:/Users/glynch/dev/IdeaProjects/bxbot/target/bxbot-parent-0.10.0-SNAPSHOT/libs/bxbot-app-0.10.0-SNAPSHOT.jar!/BOOT-INF/lib/spring-core-5.0.6.RELEASE.jar!/) to method java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain) WARNING: Please consider reporting this to the maintainers of org.springframework.cglib.core.ReflectUtils$1 WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations WARNING: All illegal access operations will be denied in a future release ./logs/bxbot.log

See: https://github.com/dsyer/spring-boot-java-10#create-a-spring-boot-application You can switch this warning off by adding --illegal-access=deny to the command line.

Looks like fix coming in Boot 2.1.0 ...

Spring Framework ticket - https://jira.spring.io/browse/SPR-15859

gazbert commented 6 years ago

Released.