![]() |
VOOZH | about |
dotnet tool install --global MASES.JNetReflector --version 2.6.9
dotnet new tool-manifestif you are setting up this repo
dotnet tool install --local MASES.JNetReflector --version 2.6.9
#tool dotnet:?package=MASES.JNetReflector&version=2.6.9
nuke :add-package MASES.JNetReflector --version 2.6.9
The tool is able to build .NET classes which reproduce the JVM™ class (Java™, Scala, Kotlin, ...) counterpart.
To install the tool follows the instructions on NuGet and https://docs.microsoft.com/en-us/dotnet/core/tools/global-tools.
To use JNetReflector runs a command like the following:
jnetreflector -OriginRootPath C:\\myJars -OriginJavadocUrl \"https://thehost/javadoc/\" -JavadocVersion 11 -DestinationRootPath C:\\ReflectionDestination
If the previous command raises the error described in , the only solution is to apply the following workaround (within an elevated shell) and disable CET:
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\jnetreflector.exe" /v MitigationOptions /t REG_BINARY /d "0000000000000000000000000000002000" /f
jnetreflector accepts the following command-line switch:
Many JNet classes are generated using JNetReflector. The JVM™ used to build the classes is the Temurin version 11 which is the minimum JVM™ version supported from JCOBridge. The command line interface uses the following command line:
jnetreflector -TraceLevel 0 -DestinationRootPath .\src\ -ConfigurationFile .\src\configuration.json
The options used are:
{
"RelativeDestinationCSharpClassPath": "net\\JNet\\Generated",
"RelativeDestinationJavaListenerPath": "jvm\\jnet\\src\\main\\java",
"JavaListenerBasePackage": "org.mases.jnet.generated",
"PreferMethodWithSignature": true,
"OnlyPropertiesForGetterSetter": true,
"JarList": [
"rt.jar"
],
"OriginJavadocJARVersionAndUrls": [
{
"Version": 8,
"Url": "https://docs.oracle.com/javase/8/docs/api/"
}
],
"NamespacesToAvoid": [
"org.jcp.xml.dsig.internal",
"com.oracle",
"com.sun",
"java.awt.peer",
"javax.crypto",
"jdk",
"org.mases",
"org.junit",
"org.hamcrest",
"org.burningwave",
"org.graalvm",
"org.omg",
"org.slf4j",
"sun"
],
"ClassesToBeListener": [
"java.lang.Runnable",
"java.util.concurrent.Callable",
"javax.swing.Action",
"javax.management.NotificationFilter"
],
"ClassesManuallyDeveloped": [
"java.util.Comparator",
"java.util.EventListener"
],
"ClassesToAvoid": [
"java.lang.ProcessBuilder$Redirect$Type",
"java.lang.Thread$UncaughtExceptionHandler",
"java.util.stream.DoubleStream$Builder",
"java.util.stream.IntStream$Builder",
"java.util.stream.LongStream$Builder",
"java.util.stream.Stream$Builder",
"java.util.ServiceLoader$Provider",
"javax.swing.ToolTipManager",
"javax.swing.text.html.HTMLEditorKit$LinkController",
"javax.swing.plaf.basic.BasicButtonListener",
"javax.swing.plaf.basic.BasicTreeUI$MouseHandler",
"javax.swing.plaf.basic.BasicDesktopIconUI$MouseInputHandler",
"javax.swing.plaf.basic.BasicTabbedPaneUI$FocusHandler",
"javax.swing.plaf.basic.BasicComboBoxUI$KeyHandler",
"javax.swing.plaf.basic.BasicSliderUI$ComponentHandler",
"javax.swing.plaf.basic.BasicComboPopup$InvocationKeyHandler",
"javax.swing.plaf.basic.BasicTreeUI$KeyHandler",
"javax.swing.plaf.basic.BasicTreeUI$ComponentHandler",
"javax.swing.plaf.basic.BasicSplitPaneUI$FocusHandler",
"javax.swing.plaf.basic.BasicTabbedPaneUI$MouseHandler",
"javax.swing.plaf.basic.BasicOptionPaneUI$ButtonActionListener",
"javax.swing.plaf.basic.BasicToolBarUI$DockingListener",
"javax.swing.plaf.basic.BasicScrollPaneUI$HSBChangeListener",
"javax.swing.plaf.basic.BasicInternalFrameUI$InternalFramePropertyChangeListener",
"javax.swing.plaf.basic.BasicSliderUI$ScrollListener",
"javax.swing.plaf.basic.BasicSliderUI$TrackListener",
"javax.swing.plaf.basic.BasicScrollPaneUI$VSBChangeListener",
"javax.swing.plaf.metal.MetalComboBoxUI$MetalPropertyChangeListener",
"javax.tools.DiagnosticListener",
"javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter",
"javax.xml.soap.SAAJResult"
],
"NamespacesInConflict": [
"java.lang.module",
"java.awt.color",
"java.awt.desktop",
"java.awt.image",
"java.awt.event",
"java.awt.font"
],
"ClassesToAvoidInGenerics": [
"java.time.chrono.ChronoLocalDateTime",
"java.time.chrono.ChronoZonedDateTime"
]
}
The command above fails in PowerShell because the nested class separator ($) is used from PowerShell to substitute variable values. The previous command runs without problems in a Windows Command Prompt
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 net8.0 is compatible. net8.0-android net8.0-android was computed. net8.0-browser net8.0-browser was computed. net8.0-ios net8.0-ios was computed. net8.0-maccatalyst net8.0-maccatalyst was computed. net8.0-macos net8.0-macos was computed. net8.0-tvos net8.0-tvos was computed. net8.0-windows net8.0-windows was computed. net9.0 net9.0 was computed. net9.0-android net9.0-android was computed. net9.0-browser net9.0-browser was computed. net9.0-ios net9.0-ios was computed. net9.0-maccatalyst net9.0-maccatalyst was computed. net9.0-macos net9.0-macos was computed. net9.0-tvos net9.0-tvos was computed. net9.0-windows net9.0-windows was computed. net10.0 net10.0 was computed. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
This package has no dependencies.
| Version | Downloads | Last Updated |
|---|---|---|
| 2.6.9 | 92 | 6/15/2026 |
| 2.6.9-rc996 | 89 | 6/9/2026 |
| 2.6.9-rc995 | 103 | 6/7/2026 |