agentdebug icon indicating copy to clipboard operation
agentdebug copied to clipboard

unable to compile on java 1.8

Open JonBruchim opened this issue 4 years ago • 2 comments

Hi,

I've been trying to build the agent on java 1.8 with the following errors agentdebug/src/main/java/ee/schimke/AgentMain.java:3: error: package com.sun.tools.attach does not exist import com.sun.tools.attach.AgentInitializationException;

With java 11 I am successfully running your code and the agent is working perfectly.

What could be the possible problem causing this error?

thank you

JonBruchim avatar Dec 22 '21 15:12 JonBruchim

At minimum you will have to change the call to is.readAllBytes.

https://docs.oracle.com/javase/9/docs/api/java/io/InputStream.html#readAllBytes--

But openjdk8 definitely has that package

image

Is it possible you are using a JRE? Looks like it is related to tools.jar in older JVMs.

https://stackoverflow.com/questions/11901156/missing-library-com-sun-tools-attach

yschimke avatar Dec 22 '21 16:12 yschimke

thanks, will look into it right now

JonBruchim avatar Dec 22 '21 22:12 JonBruchim