Skip to content

Use teavm from classpath, not from IDEA plugin folder during compilation with IDEA plugin #685

Open
@Ihromant

Description

@Ihromant

During investigation of #679 I noticed previously mentioned bug again.
Steps to reproduce:
In IDEA I updated teavm plugin 0.9.0-dev-2 -> 0.9.0-dev-3. Went directly into main method for JS client and added lines:

        List<CharSequence> sequences = new ArrayList<>();
        CharSequence stringBuilder = new StringBuilder();
        sequences.add(stringBuilder);
        sequences.add("b");
        sequences.forEach(cs -> System.out.println(cs.isEmpty()));

This code compiled in IDEA successfully, but failed in console with obvious reason:

[ERROR] Method java.lang.CharSequence.isEmpty()Z was not found
    at ua.ihromant.sod.web.local.Client.lambda$main$0(Client.java:15)
    at ua.ihromant.sod.web.local.Client$main$lambda$_1_0.accept(Client.java:15)
    at ua.ihromant.sod.web.local.Client$main$lambda$_1_0.accept(Client.java:15)
    at java.util.ArrayList.forEach(TArrayList.java:195)
    at ua.ihromant.sod.web.local.Client.main(Client.java:15)

This means that IDEA during compilation uses copy of teavm library present in plugin folder, but not teavm from classpath (0.9.0-dev-2 where CharSequence.isEmpty method is missing).

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions