Skip to content

Conversation

@mbien
Copy link
Member

@mbien mbien commented Jun 21, 2025

  • JDK 25+ contains the fix already - no patching needed (JDK-8353950)
  • avoids trouble with ASM or other unexpected interactions

downgraded classfile version of the agent to 8, so that the JDK warning msg popup can show (#8608 (comment)).

@mbien mbien added this to the NB27 milestone Jun 21, 2025
@mbien mbien added Platform [ci] enable platform tests (platform/*) UI User Interface os:windows ci:dev-build [ci] produce a dev-build zip artifact (7 days expiration, see link on workflow summary page) labels Jun 21, 2025
Copy link
Contributor

@matthiasblaesing matthiasblaesing left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see the need for this rush, but looks fine (eyeballed only).

@mbien
Copy link
Member Author

mbien commented Jun 21, 2025

NB 27 will be able to run on JDK 25, so its just in time so to speak.

@matthiasblaesing
Copy link
Contributor

NB 27 will be able to run on JDK 25, so its just in time so to speak.

I ran NB 26 on JDK25 with JDK-8353950 in with and without agent. The copy-cycle test with notepad worked fine.

@mbien
Copy link
Member Author

mbien commented Jun 21, 2025

I did run it on JDK 26 too, I even changed JDK's class version value to cause an ASM failure to check if it cleanly exits. JDK is a moving target which receives updates while NB releases are frozen in time. I don't like to wait for things to break when it is easy to turn them off for JDK versions on which they aren't needed anyway.

@mbien
Copy link
Member Author

mbien commented Jun 21, 2025

also while testing I noticed that the JDK warning window can't pop up on windows, but this is probably not worth fixing since its temporary and many will use the bundle installers.

PS C:\Program Files\Apache NetBeans\bin> .\netbeans.exe

The launcher has determined that the parent process has a console and will reuse it for its own console output.
Closing the console will result in termination of the running program.
Use '--console suppress' to suppress console output.
Use '--console new' to create a separate console window.
Exception in thread "main" java.lang.UnsupportedClassVersionError: org/netbeans/agent/NetBeansAgent has been compiled by a more recent version of the Java Runtime (class file version 61.0), this version of the Java Runtime only recognizes class file versions up to 52.0
        at java.lang.ClassLoader.defineClass1(Native Method)
        at java.lang.ClassLoader.defineClass(ClassLoader.java:756)
        at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
        at java.net.URLClassLoader.defineClass(URLClassLoader.java:473)
        at java.net.URLClassLoader.access$100(URLClassLoader.java:74)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:369)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:363)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:362)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:418)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:352)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:351)
        at sun.instrument.InstrumentationImpl.loadClassAndStartAgent(InstrumentationImpl.java:304)
        at sun.instrument.InstrumentationImpl.loadClassAndCallPremain(InstrumentationImpl.java:401)
FATAL ERROR in native method: processing of -javaagent failed

@mbien mbien force-pushed the no-agent-after-25 branch from 5e6105d to 31ae685 Compare June 21, 2025 14:33
@mbien
Copy link
Member Author

mbien commented Jun 21, 2025

fixed that too since it was easy to do

 - JDK 25+ contains JDK-8353950 already - no patching needed
 - avoids trouble with ASM or other unexpected interactions

downgraded classfile version of the agent to 8, so that the JDK
warning msg popup can show.
@mbien mbien force-pushed the no-agent-after-25 branch from 31ae685 to 29348cf Compare June 21, 2025 14:43
Copy link
Contributor

@matthiasblaesing matthiasblaesing left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still looks sane.

@mbien mbien merged commit 7b69bb5 into apache:master Jun 22, 2025
32 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci:dev-build [ci] produce a dev-build zip artifact (7 days expiration, see link on workflow summary page) os:windows Platform [ci] enable platform tests (platform/*) UI User Interface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants