teavm icon indicating copy to clipboard operation
teavm copied to clipboard

Does teaVM support Socket and JavaCV

Open JianLinWei1 opened this issue 5 years ago • 10 comments

Does teaVM support Socket and JavaCV

JianLinWei1 avatar Jul 01 '20 05:07 JianLinWei1

TeaVM allows HTTP calls using the browser APIs and REST wrappers. You can also access browser APIs for WebSockets.

I don't know of anyone who has made JavaCV bindings. Does it require native code?

What are you trying to do? If we knew more about your project we could give more complete advice.

ScraM-Team avatar Jul 10 '20 02:07 ScraM-Team

Does it require native code?

I assume TeaVM can't work with dependencies that contain native code. Right?

aghasemi avatar Nov 10 '20 09:11 aghasemi

I assume TeaVM can't work with dependencies that contain native code. Right?

Right

konsoletyper avatar Nov 10 '20 10:11 konsoletyper

Thanks. Makes total sense.

aghasemi avatar Nov 10 '20 10:11 aghasemi

Hi again,

Does this error mean one of the dependencies has native code?

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project TVM: Fatal error compiling: java.lang.ExceptionInInitializerError: com.sun.tools.javac.code.TypeTags -> [Help 1]

aghasemi avatar Nov 10 '20 20:11 aghasemi

Have no idea. It's only short part of some Maven output. How can I make conclusions? I see that error is thrown from within maven-compiler-plugin, does this mean that you hit a bug in Java compiler?

konsoletyper avatar Nov 10 '20 20:11 konsoletyper

Thanks, now that you are online :) I see this error when adding Apache OpenNLP as a dependency:

[ERROR] Failed to execute goal org.teavm:teavm-maven-plugin:0.6.1:compile (web-client) on project TVM: Unexpected error occurred: Unsupported class file major version 58 -> [Help 1]

Already tried different version of the library and different values for java.version. Any idea?

aghasemi avatar Nov 10 '20 20:11 aghasemi

Looks like bytecode version you feed to TeaVM is not supported. I don't remember exact version of Java supported by TeaVM, perhaps it's around 13 or 14

konsoletyper avatar Nov 10 '20 20:11 konsoletyper

Class file major version 58 is for Java 14. Will update here if I manage to solve it.

P.S. TeaVM apparently works with up to Java 13.

aghasemi avatar Nov 10 '20 20:11 aghasemi

Update: Using JDK 11 instead of 14 as compiler solved that issue. java.version didn't help.

So apparently they call it LTS for a reason!

aghasemi avatar Nov 10 '20 21:11 aghasemi