You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

在Rider中为Xamarin.Android项目回退JDK版本至1.8

Fixing "AdjustJavacVersionArguments" Failure with JDK 1.8 in Rider (Mac OS)

Hey there, I’ve run into this exact issue before with Xamarin.Droid and JDK versions—let’s get you sorted out step by step. The root problem here is that older Xamarin.Droid versions don’t play nice with JDK 9+, so forcing JDK 1.8 is the way to go. Here’s how to do it in Rider and system-wide:

1. First, confirm you have JDK 1.8 installed

If you don’t already have it, grab a compatible build (I recommend Azul’s Zulu JDK for licensing flexibility, or Oracle’s JDK 8 if you have a license). To check what you have installed, open Terminal and run:

java -version

If you see a 1.8.x version listed, note its installation path (usually something like /Library/Java/JavaVirtualMachines/jdk1.8.xxx.jdk/Contents/Home).

2. Set JDK 1.8 as the default in Rider’s global settings

  • Open Rider and go to Rider > Settings (or press Cmd + ,).
  • Navigate to Build, Execution, Deployment > SDKs > JDK.
  • Click the + button in the top-left corner, then select JDK from the dropdown.
  • Browse to the JDK 1.8 installation path you noted earlier and select it.
  • Click the star icon next to the new JDK entry to set it as your default global JDK.

3. Override JDK settings for your Xamarin.Droid project

Sometimes global settings don’t apply to individual projects, so let’s lock this in at the project level:

  • Right-click your Xamarin.Droid project in the Solution Explorer and select Properties.
  • Go to Android Options > Advanced.
  • In the Java Development Kit Location dropdown, pick the JDK 1.8 you just added.
  • Double-check that Java Compiler Version is set to 1.8 (not higher) in the same section.

4. (Optional) Set JAVA_HOME system-wide (if Rider still isn’t picking it up)

If you’re still seeing issues, force your system to use JDK 1.8 by setting the JAVA_HOME environment variable:

  • Open Terminal and edit your shell profile file. If you use Zsh, run nano ~/.zshrc; for Bash, use nano ~/.bash_profile.
  • Add this line (replace the path with your actual JDK 1.8 location):
    export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.xxx.jdk/Contents/Home
    
  • Save the file (Ctrl+O, then Enter) and exit (Ctrl+X). Then run source ~/.zshrc (or source ~/.bash_profile) to apply the changes immediately.
  • Restart Rider to make sure it picks up the new environment variable.

5. Clean and rebuild your solution

Finally, clean out any cached build files that might be causing conflicts:

  • Go to Build > Clean Solution in Rider’s top menu.
  • Once cleaning finishes, run Build > Rebuild Solution.
  • Try launching your Android emulator again—this should resolve the AdjustJavacVersionArguments task failure.

The key here is that Xamarin.Droid relies on specific JDK 8 APIs that were changed or removed in JDK 9+, so rolling back to 1.8 eliminates those compatibility gaps.

内容的提问来源于stack exchange,提问作者bejohi

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.19 04:16:03