How to set Portrait and landscape when the APP is running ?

How to set Portrait and landscape when the APP is running ?
This is usually set by xml,This can only be set before the app runs.。
Thank you.

juce::android.getEnv();
juce::LocalRef activity (juce::android.activity.get());
These are no longer available in JUCE8
Java can no longer be called directly through jni

MyOrientationUtils.java::

//code…
package com.rmsl.juce;
package com.example.screenorientation;

import androidx.appcompat.app.AppCompatActivity;
import android.content.pm.ActivityInfo;
import android.os.Bundle;

public class MainActivity extends AppCompatActivity {

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    // 强制设置为横屏
    setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
}

}

I have tried many methods. It seems that JUCE does not have a direct method to modify Portrait and landscape during APP runtime. JAVA has a method to modify it, but I can’t figure it out. I don’t know how to use JAVA in JUCE8.