Code Monkey home page Code Monkey logo

Comments (37)

skybber avatar skybber commented on June 24, 2024 33

There will be.

from dcevm.

coolsa avatar coolsa commented on June 24, 2024 23

Not sure if it counts as it isn't directly from this project, but I noticed that the jetbrains runtime beta versions for jdk17 seem to have dcevm options available, and it seems to work for my use case (Minecraft 1.17 fabric modding).

https://github.com/JetBrains/JetBrainsRuntime/releases/tag/jbr17b135.1
has options with download links jbrsdk_dcevm-17-PLATFORM-bVERSION.tar.gz, which when using with the VM argument -XX:+AllowEnhancedClassRedefinition enables alterations to the body of a class.
I haven't run any extensive testing on it to see any limitations or differences from earlier versions of DCEVM, but it seems to work wonderfully.

Double check for a more recent release of the jbr17 betas if you follow those instructions, but otherwise hopefully this helps anyone who needs to use dcevm for java 17.

from dcevm.

MrDandas avatar MrDandas commented on June 24, 2024 4

@skybber do you have ETA ?

from dcevm.

skybber avatar skybber commented on June 24, 2024 4

We have to add it to hotswapagent pages, in the same way how the page http://hotswapagent.org/mydoc_quickstart-jdk11.html is done. Pages sources are at https://github.com/HotswapProjects/HotswapAgentPages, any help will be appreciated.

from dcevm.

skybber avatar skybber commented on June 24, 2024 3

Look at https://github.com/JetBrains/JetBrainsRuntime/releases , dcevm17 is embedded in JBR17, there isn't separate dcevm17 build. Enhanced hotswap must be explicitly turned on using -XX:+AllowEnhancedClassRedefinition

from dcevm.

skybber avatar skybber commented on June 24, 2024 3

Yes, I'm involved in the project, JB is sponsoring dcevm now.

from dcevm.

skybber avatar skybber commented on June 24, 2024 2

It is even used as a default debug enviroment for IntelliJ Idea development in Jetbrains now, it is also able to use it to run profiling tools like YourKit or JFR.

from dcevm.

skybber avatar skybber commented on June 24, 2024 1

Class hiearchy is not supported even in Jetbrains version. It has not been supported since dcevm7 and I did not port it to Jetbrains version.

from dcevm.

skybber avatar skybber commented on June 24, 2024 1

You have to use either -XX:+AllowEnhancedClassRedefinition or -XX:HotswapAgent=.. to enable advanced hotswap.

from dcevm.

tfactor2 avatar tfactor2 commented on June 24, 2024 1

Probably, worth noticing that the DCEVM is now integrated into the standard Jetbrains Runtime build according to JetBrains/JetBrainsRuntime#134.

Thank you!

from dcevm.

MrDandas avatar MrDandas commented on June 24, 2024

I need to change class hierarchy and add/remove/modify interfaces. Will check the JetBrains. Thanks

from dcevm.

skybber avatar skybber commented on June 24, 2024

Otherwise, interface addition/removal is supported.

from dcevm.

tfactor2 avatar tfactor2 commented on June 24, 2024

@skybber Cool, thanks!
Do you know the future of Trava OpenJDK?
Should jbr be used instead?

from dcevm.

skybber avatar skybber commented on June 24, 2024

Yes, jbr17 is recommended. Currently there is a bug in jbr-dcevm17, that will be fixed in the next release. Also there is an issue with HA, that is not embedded with jbr-runtime. From perspective of application developer using Spring/J2EE etc, HotswapAgent is "must have" feature.

from dcevm.

tfactor2 avatar tfactor2 commented on June 24, 2024

So, jbr with dcevm effectively cannot be used in the development process - the runtime doesn't support modifications of class signatures? Tried to add a method in an opened debug session both on jbr11 and jbr17 with dcevms with no luck:

Hot Swap failed. dcevm intellij - ...: add method not implemented dcevm intellij ...: Operation not supported by V

from dcevm.

tfactor2 avatar tfactor2 commented on June 24, 2024

Thanks, works perfectly in both 11 and 17 versions!

Regarding http://hotswapagent.org/ - for me, the solution in general even on supported JDKs (Trava) didn't work. Tried on Hibernate; the implementation relied on Hibernate internals, just stopped working with newer Hibernate releases. Thus, we can't rely on such an unstable solution in a regular development process.
For us, enhanced class redefinition would be more than enough.

from dcevm.

skybber avatar skybber commented on June 24, 2024

What version of Hibernate are you using? Please create issue at https://github.com/HotswapProjects/HotswapAgent, Otherwise we have tests up to v5.4.14 https://github.com/HotswapProjects/HotswapAgent/blob/master/plugin/hotswap-agent-hibernate-plugin/run-tests.sh

from dcevm.

tfactor2 avatar tfactor2 commented on June 24, 2024

@skybber, thanks for the quick response.
Unfortunately, used it quite a while ago, so can't tell the exact version.
We plan to migrate to Java17, thus we anyways will have to stick to JBR w/o HotswapAgent support.

from dcevm.

Jaryt avatar Jaryt commented on June 24, 2024

Not sure if it counts as it isn't directly from this project, but I noticed that the jetbrains runtime beta versions for jdk17 seem to have dcevm options available, and it seems to work for my use case (Minecraft 1.17 fabric modding).

https://github.com/JetBrains/JetBrainsRuntime/releases/tag/jbr17b135.1 has options with download links jbrsdk_dcevm-17-PLATFORM-bVERSION.tar.gz, which when using with the VM argument -XX:+AllowEnhancedClassRedefinition enables alterations to the body of a class. I haven't run any extensive testing on it to see any limitations or differences from earlier versions of DCEVM, but it seems to work wonderfully.

Double check for a more recent release of the jbr17 betas if you follow those instructions, but otherwise hopefully this helps anyone who needs to use dcevm for java 17.

Minecraft Forge modder here. Unfortunately it doesn't seem that the bootstrap launcher used by Minecraft forge is enjoying the switch to Jbr17. I believe we need these features due to our mods using Mixins and it conflicting with the ability to even hotswap inner method changes.

from dcevm.

skybber avatar skybber commented on June 24, 2024

Minecraft does not work with jbr17?

from dcevm.

Jaryt avatar Jaryt commented on June 24, 2024

Minecraft does not work with jbr17?

Turns out it was due to the Minecraft forge version, which has recently been updated!

from dcevm.

1cg avatar 1cg commented on June 24, 2024

@skybber you are doing God's work keeping the DCEVM going. It's insane that this isn't baked into the core JVM.

Do you think there will be an "official" jdk 17 release any time soon?

from dcevm.

skybber avatar skybber commented on June 24, 2024

Dcevm17 is now part of jbr runtime, that is fork of JVM with a lot of enhancements. JB moved to Europe recently, I recommend to look at theirs official statement to current situation.

from dcevm.

1cg avatar 1cg commented on June 24, 2024

Interesting. Is that good news or bad news?

When I look here:

https://github.com/JetBrains/JetBrainsRuntime

I see jdk 11 releases. Can you send me a link to their statement?

Regardless, thank you for keeping this incredibly important project alive!

from dcevm.

t-oster avatar t-oster commented on June 24, 2024

If I understand it correctly you can add HotSwapAgent manually to the JBR, so reloading will also work with spring boot and hibernate etc (TravaOpenJDK/trava-jdk-11-dcevm#46) or is this not needed?

from dcevm.

skybber avatar skybber commented on June 24, 2024

yes, just put HA into lib/hotswap/, and use -XX:HotswapAgent=fatjar

from dcevm.

1cg avatar 1cg commented on June 24, 2024

That is fantastic I have it working locally. Are you still associated with the project?

from dcevm.

TheBestPessimist avatar TheBestPessimist commented on June 24, 2024

do you know when the dcevm website will be updated with this information?

from dcevm.

TheBestPessimist avatar TheBestPessimist commented on June 24, 2024

And i think the readme here should also be updated to point out the jetbrains replacement.

from dcevm.

skybber avatar skybber commented on June 24, 2024

Anyway, there are many dcevm fixes in JBR 11/17 now, but it's still not 100% stable, especially the rare case where adding/removing fields is difficult to solve if stack frames contain old instances replaced by scalars. Maybe Oracle is aware of this and that's why they don't include dcevm in the standard hotspot, maybe the reason is completely different - they are working on a solution in Graal, but according to the specs this solution is far from better than dcevm.

from dcevm.

1cg avatar 1cg commented on June 24, 2024

@skybber do you have a github sponsor or similar set up? I'd like to sponsor your DCEVM work.

(Jetbrains recently sponsored me for htmx, and this is far more imporant work than that!)

from dcevm.

skybber avatar skybber commented on June 24, 2024

Personally I don't have it, there quite a lot of people involved in HA+dcevm, it would be ... selfish to have sponsors just for myself.

from dcevm.

1cg avatar 1cg commented on June 24, 2024

:) Is there a place where you all meet to discuss? If so, and if you don't mind, it would be great to get this work sponsored.

This is an extremely important feature for JVM languages and I'm sure many people in the community would be willing to chip in if there were a single organization to do so through!

from dcevm.

skybber avatar skybber commented on June 24, 2024

pls. conntact me by an email.

from dcevm.

jsalts avatar jsalts commented on June 24, 2024

Confirmed that this works with the jbr. I got tripped up because hotswap-agent.jar is not bundled in as far as I could tell like it used to be. You'll need the hotswap agent plugin for your IDE and then add "-XX:+AllowEnhancedClassRedefinition -XX:HotswapAgent=fatjar" to your VM options. You seem to be able to ignore messages about the plugin not being able to determine the dcevm version.

from dcevm.

gdrte avatar gdrte commented on June 24, 2024

Some one from Jetbrains advised -XX:HostswapAgent is not required any more as this is baked into the JBR itself.
https://youtrack.jetbrains.com/issue/JBR-5195/I-sometime-have-my-project-that-is-blocked-from-starting-and-i-have-the-feeling-that-there-is-a-deadlock-somwhere-during-the
@skybber Can you please clarify.
Thank you!

from dcevm.

skybber avatar skybber commented on June 24, 2024

HotswapAgent is not in JBR, if you need it you can either:

  • put hotswap-aget.jar it into $JAVA_HOME/lib/hotswap/ and use -XX:HotswapAgent=fatjar
  • or use -XX:HotswapAgent=external -javaagent:<path>/hotswap-agent.jar

from dcevm.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.