Java GWT Application - Compile Works Sometimes and Sometimes Not

Henry :

Hopefully I provide everything needed for this:

Java 8 GWT 2.5.1 Eclipse 2018-09 (4.9.0) Git

I have a project that I cannot get to consistently compile. In Eclipse, I compile using the GWT -> Compile option, while on our web servers we use Ant.

I can get successful compiles on one or more of these machines (we have a Dev and a QA server). I can get them to compile once, twice, maybe three times. Then, on any machine, it will fail and fail and fail.

The error is this:

[ERROR] Errors in 'jar:file:/C:/Users/htaylor/git/codemanagerclient/CodeManagerClient/war/WEB-INF/lib/guava-gwt-12.0.jar!/com/google/common/base/Strings.java' [ERROR] Line 1: The type java.util.regex.Pattern cannot be resolved. It is indirectly referenced from required .class files

I've only been coding with Java for a bit over a year and I'm just frankly stumped. I don't understand why it would compile one time and then not the next, even when done immediately after the successful one. To me, it suggests that something is not getting done in the same, proper, order each time.

I'm just wondering if anyone can help shed some light on this.

Henry :

I appreciate your comments. I do not disagree with those of you saying our stuff is too old. It definitely is. The reasons for that are complicated. All I can say is, we're working on it.

I also appreciate the suggestion about using regex from the GWT libraries. I may test that out.

I did resolve my problem, not so much by solving it as by working around it. I was able to determine that we only used one method from the Strings.java class, and that was isNullOrEmpty(). And we only used it a few times in two classes. I just wrote a local version of that method in those classes, which meant that the compiler was no longer looking for the class. It's cheesy and is essentially a dodge, but it worked in this case.

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=420051&siteId=1