build successful but not editable

28 views
Skip to first unread message

veronica...@gmail.com

unread,
Jul 18, 2020, 3:58:01 PM7/18/20
to JaCoCo and EclEmma Users
Good Day,
I am a college student and have some eclipse environment set up issues, wish you could help.
Eclipse : 2020-06 (4.16.0)
Java: 9.0.4
JDK: 9.0.4
Maven: 3.6.3
m2e : 1.16.0

Here is the process I import jacoco into Eclipse:
Part one:
1. I import projects from Git (with smart import).
2. copy jacoco github uri.
3. select only master branch to work with.
4.Select the 1st jacoco folder and import it as maven project.
5.The jacoco maven structure is as fig 5.
6. Run "mvn clean verify" under org.jacoco.build folder, and it builds successful.
7. I didn't seen any jar file after update the maven project, the structure is like fig 7.
8. I was not able to edit the java file, the error said: This compilation unit is not on the build path of a java project. like fig8 (I checked the project nature is Maven nature), also I was not able to use command + click to navigate to a method definition, key words, methods, variables etc are not highlighted by different color like normal java file.

Part two:
This time I deleted the whole maven project in eclipse and cleaned up the work space, then repeated part one's step 1 to 3,  
4, I imported all the eclipse projects except the first maven project instead, as fig 9.
5. The structure is as fig 10, there is an error signal in each project.
6. Run "mvn clean verify" under org.jacoco.build folder, this time I encountered build failures on org.jacoco.core.test.validation.kotlin, and org.jacoco.core.test.validation.scala as fig 11. I fixed this by change the bytecode.version from 6 to 7.
7. Even though there were errors everywhere in the projects, but it still can build successful, and this time I see target file and jar file like fig 12. Also this time all the java files appeared to be normal, I can edit, use short cut.

Would you please tell me why in part one, I was not able to edit java file, and why in part two, there were errors everywhere. 
Wish you a good weekend.

Screen Shot 2020-07-18 at 14.26.05.png

fig1Screen Shot 2020-07-18 at 14.26.25.png
fig2Screen Shot 2020-07-18 at 14.26.44.pngfig3

Screen Shot 2020-07-18 at 14.27.14.png

fig4Screen Shot 2020-07-18 at 14.27.26.png

fig 5


Screen Shot 2020-07-18 at 15.01.48.png
fig6

Screen Shot 2020-07-18 at 15.14.25.png

fig 7

Screen Shot 2020-07-18 at 14.27.59.png

fig 8 

Screen Shot 2020-07-18 at 15.26.00.png

fig 9

Screen Shot 2020-07-18 at 15.35.55.png

fig 10

Screen Shot 2020-07-18 at 15.39.12.png

fig 11
Screen Shot 2020-07-18 at 15.49.32.pngfig 12






















Marc Hoffmann

unread,
Jul 20, 2020, 9:24:50 AM7/20/20
to jac...@googlegroups.com
Hi,

I think you’re first approach is almost right:

1) Clone the jacoco repo from Hithub
2) Then in the Repository view right-click on “Working Tree” node and select “Import Projects…”
3) Now select *all* projects for import

Regards,
-marc



Good Day,
























--
You received this message because you are subscribed to the Google Groups "JaCoCo and EclEmma Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jacoco+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jacoco/977ad1ac-8e60-4293-b2a4-022b12b0f951o%40googlegroups.com.
<Screen Shot 2020-07-18 at 14.26.05.png><Screen Shot 2020-07-18 at 14.26.25.png><Screen Shot 2020-07-18 at 14.26.44.png><Screen Shot 2020-07-18 at 14.27.14.png><Screen Shot 2020-07-18 at 14.27.26.png><Screen Shot 2020-07-18 at 15.01.48.png><Screen Shot 2020-07-18 at 15.14.25.png><Screen Shot 2020-07-18 at 14.27.59.png><Screen Shot 2020-07-18 at 15.26.00.png><Screen Shot 2020-07-18 at 15.35.55.png><Screen Shot 2020-07-18 at 15.39.12.png><Screen Shot 2020-07-18 at 15.49.32.png>

Message has been deleted

veronica...@gmail.com

unread,
Jul 20, 2020, 12:57:57 PM7/20/20
to JaCoCo and EclEmma Users
Hi Marc,
It's working, thanks for your help! I'm a newbie to Eclipse, I even didn't realize to change the IDE's perspective.

在 2020年7月18日星期六 UTC-4下午3:58:01,veronica...@gmail.com写道:

Marc Hoffmann

unread,
Jul 20, 2020, 1:19:39 PM7/20/20
to jac...@googlegroups.com
Ok, good hear!

good luck for your project,
-marc

--
You received this message because you are subscribed to the Google Groups "JaCoCo and EclEmma Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jacoco+un...@googlegroups.com.

Veronica Sheng

unread,
Jul 23, 2020, 9:43:45 PM7/23/20
to jac...@googlegroups.com
Good evening Marc,
I’m trying to run CoreTutorial.java locally, I mean I I copied CoreTutorial.java to my workspace in Eclipse, installed Jacoco library, and asm 8.0.1, however I got this error out

The ClassReader.java is not reachable, and said no source attachment, (other functions are reachable) referenced libraries are as followed

Would you please tell me how to fix this?

You received this message because you are subscribed to a topic in the Google Groups "JaCoCo and EclEmma Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/jacoco/wWQBwA4p_Cw/unsubscribe.
To unsubscribe from this group and all its topics, send an email to jacoco+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jacoco/44884EE7-5C7F-4ED3-9D32-F9C7C64F993E%40mountainminds.com.

Marc Hoffmann

unread,
Jul 24, 2020, 12:07:57 AM7/24/20
to jac...@googlegroups.com
Please provide the full stack trace as TEXT.

The image clips the important information.

Also: What Java version are you using?

On 24. Jul 2020, at 03:43, Veronica Sheng <veronica...@gmail.com> wrote:

Good evening Marc,
I’m trying to run CoreTutorial.java locally, I mean I I copied CoreTutorial.java to my workspace in Eclipse, installed Jacoco library, and asm 8.0.1, however I got this error out
<Screen Shot 2020-07-23 at 21.33.23.png>

The ClassReader.java is not reachable, and said no source attachment, (other functions are reachable) referenced libraries are as followed
<Screen Shot 2020-07-23 at 21.33.48.png>

Veronica Sheng

unread,
Jul 24, 2020, 10:18:40 AM7/24/20
to jac...@googlegroups.com
I’m using Java 14.
Exception in thread "main" java.lang.AbstractMethodError: Receiver class org.jacoco.core.runtime.LoggerRuntime does not define or inherit an implementation of the resolved method 'abstract int generateDataAccessor(long, java.lang.String, int, org.jacoco.asm.MethodVisitor)' of interface org.jacoco.core.runtime.IExecutionDataAccessorGenerator.
at org.jacoco.core.internal.instr.ClassFieldProbeArrayStrategy.genInitializeDataField(ClassFieldProbeArrayStrategy.java:120)
at org.jacoco.core.internal.instr.ClassFieldProbeArrayStrategy.createInitMethod(ClassFieldProbeArrayStrategy.java:93)
at org.jacoco.core.internal.instr.ClassFieldProbeArrayStrategy.addMembers(ClassFieldProbeArrayStrategy.java:64)
at org.jacoco.core.internal.instr.ClassInstrumenter.visitTotalProbeCount(ClassInstrumenter.java:82)
at org.jacoco.core.internal.flow.ClassProbesAdapter.visitEnd(ClassProbesAdapter.java:99)
at org.jacoco.asm.ClassReader.accept(ClassReader.java:692)
at org.jacoco.asm.ClassReader.accept(ClassReader.java:400)
at org.jacoco.core.instr.Instrumenter.instrument(Instrumenter.java:89)
at org.jacoco.core.instr.Instrumenter.instrument(Instrumenter.java:107)
at org.jacoco.core.instr.Instrumenter.instrument(Instrumenter.java:134)
at demo.CoreTutorial.execute(CoreTutorial.java:123)
at demo.CoreTutorial.main(CoreTutorial.java:210)


Reply all
Reply to author
Forward
0 new messages