Understanding the Eclipse classpath declarations

前端 未结 2 685
慢半拍i
慢半拍i 2021-02-08 13:10

I\'m trying to understand the Eclipse classpath file, in particular, I want to know this:

  1. How is the JRE using it (i.e. is the JVM reading this xml file directl

相关标签:
2条回答
  • 2021-02-08 13:57

    Two different things:

    1) Project classpath is used to compile your code using Eclipse Java Compiler (ejc), so the file information is passed to the EJC.

    2) When you create a launch configuration, you are actually declaring the classpath to run your application, which, by default, is based on your project classpath. This classpath is passed as an argument to the JVM like you would do it manually (java -cp ${classpathentries} yourmainclass). If you want to find out what is precisely the classpath of your launch configuration, launch your app/classes in debug mode, and in the Debug view, select your process and click on Properties where you will see the full classpath (all the jars/directories that are passed as argument to the JVM)

    NB: I cannot see your ivy path stuff.

    0 讨论(0)
  • 2021-02-08 14:04

    The problem could be :

    It means in your eclipse classpath, you should be having two different version of the same class (two different jar files of different version). If thats the case, then try remove one. Also in your eclipse build path there is something called "Build Order" where you can specify the order of the classpath jar try changing that.

    0 讨论(0)
提交回复
热议问题