question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Xlint:path error with JUNG, Gradle and Error Prone

See original GitHub issue

Hi Error Prone team.

This is an issue which I posted already on https://github.com/jrtom/jung/issues/66. @jrtom seems to be at a loss as to what’s causing it, so I wonder if someone on the Error Prone team can help me.

I’ve pasted the original issue text below so that people don’t have to follow the link to read it.

When I try to run gradle run with the following build.gradle

plugins {
  id 'application'
  id 'java'
  id 'net.ltgt.errorprone' version '0.0.8'
}

group 'org.jbduncan'
version '1.0-SNAPSHOT'

sourceCompatibility = 1.8

mainClassName = 'org.jbduncan.helloworld.HelloWorld'

repositories {
  jcenter()
}

dependencies {
  compile 'net.sf.jung:jung-graph-impl:2.1.1'
  errorprone 'com.google.errorprone:error_prone_core:2.0.11'
}

tasks.withType(JavaCompile) {
  options.encoding = 'UTF-8'
  options.compilerArgs = [
    '-Xlint:all',
    '-Werror'
  ]
}

and this class

package org.jbduncan.helloworld;

public final class HelloWorld {
  public static void main(String[] args) {
    System.out.println("Hello, world!");
  }
}

it emits the following message.

:compileJava                                                                     
warning: [path] bad path element "C:\Users\Jonathan\.gradle\caches\modules-2\files-2.1\net.sf.jung\jung-graph-impl\2.1.1\8293acb2ab4c00a3939cb99a8751e5d38a4299dc\jung-api-2.1.1.jar": no such file or directory
warning: [path] bad path element "C:\Users\Jonathan\.gradle\caches\modules-2\files-2.1\net.sf.jung\jung-graph-impl\2.1.1\8293acb2ab4c00a3939cb99a8751e5d38a4299dc\guava-19.0.jar": no such file or directory
warning: [path] bad path element "C:\Users\Jonathan\.gradle\caches\modules-2\files-2.1\net.sf.jung\jung-api\2.1.1\e47ee4efdfacce12f0af620747d9d0e44bf2eaa4\guava-19.0.jar": no such file or directory
error: warnings found and -Werror specified
1 error                     
3 warnings
:compileJava FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':compileJava'.
> Compilation failed with exit code 1; see the compiler error output for details.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 5.488 secs

When I investigate the contents of my Gradle cache, I can see that, indeed, the jar files mentioned above simply don’t exist.

When I look into C:\Users\Jonathan\.gradle\caches\modules-2\files-2.1\net.sf.jung\jung-graph-impl\2.1.1\8293acb2ab4c00a3939cb99a8751e5d38a4299dc\jung-graph-impl-2.1.1.jar, the META-INF/MANIFEST.MF contains this text.

Manifest-Version: 1.0
Archiver-Version: Plexus Archiver
Created-By: Apache Maven 3.0.5
Built-By: jrtom
Build-Jdk: 1.8.0-google-v7
Class-Path: jung-api-2.1.1.jar guava-19.0.jar

I get the same problem with JUNG versions 2.1 and 2.0, and no other library with dependencies I’ve tried seems to have this problem.

However the problem goes away when I exclude from build.gradle the lines id 'net.ltgt.errorprone' version '0.0.8' and errorprone 'com.google.errorprone:error_prone_core:2.0.11', so it’s not clear to me if this is a problem with JUNG or if it’s gradle-errorprone-plugin or Error Prone related.

(Since writing the original issue, I upgraded from Error Prone 2.0.11 to 2.0.13, but that didn’t seem to solve my problem.)

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:9 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
cushoncommented, Oct 25, 2016

I don’t think there’s a gradle bug here beyond the underlying JSR 199 bug.

I suggest having JUNG not set Class-Path in the jar’s manifest. Removing <addClasspath> from the pom should do it: https://github.com/jrtom/jung/blob/6c0a8e568a2215c15a8195f3ec75321f6241ce48/pom.xml#L152

0reactions
jbduncancommented, Mar 27, 2017

Thank you everyone, @cushon and @tbroyer included. It seems it was a bug in how the JUNG jar was being built, which I’ve submitted a fix for, so I’m closing this issue for now.

@cushon, on a related note, have you received any news regarding the bug in JSR 199 which you queried about at http://mail.openjdk.java.net/pipermail/compiler-dev/2016-October/010455.html?

Read more comments on GitHub >

github_iconTop Results From Across the Web

How do I fix this Xlint:path error when using Gradle, JUNG and ...
I am having difficulty getting JUNG and Error Prone to work nicely together in my Gradle based Java project, and I wonder if...
Read more >
Unable to use -Xlint:all in a Gradle project with gradle ...
I am having difficulty getting my Gradle project, which uses a graph library called JUNG and the gradle-errorprone-plugin, to compile Java ...
Read more >
Installation - Error Prone
Our goal is to make it simple to add Error Prone checks to your existing Java compilation. Please note that Error Prone must...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found