Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Headless AWT Support #298

Closed
GeorgeS2019 opened this issue Mar 12, 2023 · 12 comments
Closed

Headless AWT Support #298

GeorgeS2019 opened this issue Mar 12, 2023 · 12 comments

Comments

@GeorgeS2019
Copy link

GeorgeS2019 commented Mar 12, 2023

I understand there is no java.awt UI.

I wonder if the image part can be included?

---> System.NullReferenceException: Object reference not set to an instance of an object.
at IKVM.Java.Externs.java.lang.Class.forName0(String name, Boolean initialize, ClassLoader loader, Class caller)
at java.lang.Class.forName0(String name, Boolean initialize, ClassLoader loader, Class caller)
at java.lang.Class.forName(String className, CallerID )
at java.awt.GraphicsEnvironment.createGE()
at java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment()
at java.awt.image.BufferedImage.createGraphics()

@wasabii
Copy link
Contributor

wasabii commented Mar 14, 2023

Correct. The AWT stuff is non functional.

@wasabii wasabii marked this as a duplicate of #144 Mar 14, 2023
@wasabii wasabii closed this as completed Mar 14, 2023
@wasabii wasabii marked this as not a duplicate of #144 Mar 14, 2023
@wasabii
Copy link
Contributor

wasabii commented Mar 14, 2023

Headless graphics should be working and enabled by default though. I don't see an open bug for that specifically, so I'll leave this as it.

@wasabii wasabii reopened this Mar 14, 2023
@wasabii wasabii changed the title Missing java.awt.image.BufferedImage.createGraphics()? Headless AWT Support Mar 14, 2023
@wasabii
Copy link
Contributor

wasabii commented Mar 14, 2023

AWT related stuff isn't my focus at present. This is an open source project, feel free to contribute.

@wasabii
Copy link
Contributor

wasabii commented Apr 22, 2023

Headless graphics should be working and enabled by default though. I don't see an open bug for that specifically, so I'll leave this as it.

@wasabii wasabii reopened this Apr 22, 2023
@wasabii
Copy link
Contributor

wasabii commented Apr 27, 2023

Reopened, again.

@wasabii wasabii reopened this Apr 27, 2023
@TheLastRar
Copy link
Contributor

TheLastRar commented Jun 2, 2023

The posted stack-trace is because the property java.awt.graphicsenv is not set (and thus null)
On JVM (on windows) this value is set to sun.awt.Win32GraphicsEnvironment however that class appears to be absent in IKVM

On IKVM you instead have ikvm.awt.NetGraphicsEnvironment, located in the IKVM.AWT.WinForms project.
IKVM.AWT.WinForms however doesn't seem to be compiled as part of build and thus not included and can't be used.

@wasabii
Copy link
Contributor

wasabii commented Jun 7, 2023

@TheLastRar This is correct. The ikvm.awt code isn't included. It was a old hand-done attempt at an AWT layer against System.WinForms. Neither finished, nor cross platform., nor would it work in Core.

The ultimate goal I have is to finish up feature/nativelib, and include the actual OpenJDK AWT support.

@GeorgeS2019
Copy link
Author

GeorgeS2019 commented Feb 18, 2024

The ultimate goal I have is to finish up feature/nativelib, and include the actual OpenJDK AWT support.

It is now close to a further 8 months. Thanks for so much progress has been made and now the Microsoft team showing interest. Any crystal ball estimation of when the support for OpenJDK AWT would start?

@GeorgeS2019
Copy link
Author

This will be done in a couple of weeks
#381 (comment)

@DjArt
Copy link

DjArt commented May 14, 2024

I did easy adaptation of AWT.WinForms library
https://github.com/DjArt/IKVM.AWT.WinForms

@GeorgeS2019
Copy link
Author

GeorgeS2019 commented May 14, 2024

@DjArt
Thx for sharing

I tested, the headless mode using IKVM 8.8.0 FINALLY work!

@wasabii
Copy link
Contributor

wasabii commented May 26, 2024

AWT support merged into develop branch.

@wasabii wasabii closed this as completed May 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants