You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
At this point, *on macOS*, the following commands result in a build
of `samples/Hello-Java.Base` which use MonoVM + the Mono GC bridge:
# prepare and build the repo against .NET 8, as that has the needed MonoVM packages
dotnet build -c Release -t:Prepare -p:DotNetTargetFramework=net8.0 *.sln
dotnet build -c Release -p:DotNetTargetFramework=net8.0 *.sln
# Publish the Hello-Java.Base sample; must be `--self-contained` + `-p:UseMonoRuntime=true`
# to get the MonoVM
dotnet publish -c Release --self-contained -p:UseMonoRuntime=true -p:DotNetTargetFramework=net8.0 -p:UseAppHost=true -p:ErrorOnDuplicatePublishOutputFiles=false -r osx-x64 samples/Hello-Java.Base/Hello-Java.Base.csproj
# Something is missing in the targets that `Hello-Java.Base.jar` isn't copied; copy it.
# TODO: fix this.
cp samples/Hello-Java.Base/bin/Release/Hello-Java.Base.jar samples/Hello-Java.Base/bin/Release/osx-x64/publish
With that setup, you can then run the sample:
% samples/Hello-Java.Base/bin/Release/osx-x64/publish/Hello-Java.Base
MonoVM support enabled
# jonp: LoadJvmLibrary(/Library/Java/JavaVirtualMachines/microsoft-17.jdk/Contents/Home/lib/libjli.dylib)=1164832048
# jonp: JNI_CreateJavaVM=4572626688; JNI_GetCreatedJavaVMs=4572626768
# jonp: executing JNI_CreateJavaVM=1108cbf00
# jonp: r=0 javavm=11272e690 jnienv=7fe0a32e42a8
WARNING in native method: JNI call made without checking exceptions when required to from CallStaticObjectMethodV
binding? net.dot.jni.sample.MyJLO@70dea4e
Next step: how much of this works targeting win-x64?
0 commit comments