当前位置: 首页 > 知识库问答 >
问题:

Spark Scala Intellij java。lang.IllegalStateException:安装macOS Big-Sur更新后

缑兴贤
2023-03-14

我正在使用IntelliJ IDE开发Spark Scala,最近我在本地安装了Scala和Spark,并且有mac os版本的系统更新,所以不确定是什么破坏了它。

我得到的错误,当我试图建立我的项目现在,这是工作正常的前一天。我按照其他答案中的建议检查了JRE vs JDK,我确信我的项目指向JDK 1.8。此外,我从机器中删除了Scala和Spark,以确保我的机器与以前的状态相同。我仍然得到这个错误。检查相同错误的现有答案,但没有帮助。

[INFO] --- maven-surefire-plugin:2.7:test (default-test) @ dotcom-jobs ---
[INFO] Tests are skipped.
[INFO] 
[INFO] --- scalatest-maven-plugin:2.0.0:test (small-tests) @ dotcom-jobs ---
*** RUN ABORTED ***
  java.lang.IllegalStateException: Could not initialize plugin: interface org.mockito.plugins.MockMaker (alternate: null)
  at org.mockito.internal.configuration.plugins.PluginLoader$1.invoke(PluginLoader.java:74)
  at com.sun.proxy.$Proxy2.isTypeMockable(Unknown Source)
  at org.mockito.internal.util.MockUtil.typeMockabilityOf(MockUtil.java:29)
  at org.mockito.internal.util.MockCreationValidator.validateType(MockCreationValidator.java:22)
  at org.mockito.internal.creation.MockSettingsImpl.validatedSettings(MockSettingsImpl.java:241)
  at org.mockito.internal.creation.MockSettingsImpl.build(MockSettingsImpl.java:229)
  at org.mockito.internal.MockitoCore.mock(MockitoCore.java:62)
  at org.mockito.Mockito.spy(Mockito.java:1992)
  at com.homelabs.sc.rbac.utils.ConfigHelper$class.configUtil(ConfigHelper.scala:26)
  at com.homelabs.sc.rbac.base.BaseSmallTest.configUtil$lzycompute(BaseSmallTest.scala:7)
  ...
  Cause: java.lang.IllegalStateException: Failed to load interface org.mockito.plugins.MockMaker implementation declared in sun.misc.CompoundEnumeration@517d4a0d
  at org.mockito.internal.configuration.plugins.PluginInitializer.loadImpl(PluginInitializer.java:54)
  at org.mockito.internal.configuration.plugins.PluginLoader.loadPlugin(PluginLoader.java:57)
  at org.mockito.internal.configuration.plugins.PluginLoader.loadPlugin(PluginLoader.java:44)
  at org.mockito.internal.configuration.plugins.PluginRegistry.<init>(PluginRegistry.java:22)
  at org.mockito.internal.configuration.plugins.Plugins.<clinit>(Plugins.java:19)
  at org.mockito.internal.util.MockUtil.<clinit>(MockUtil.java:24)
  at org.mockito.internal.util.MockCreationValidator.validateType(MockCreationValidator.java:22)
  at org.mockito.internal.creation.MockSettingsImpl.validatedSettings(MockSettingsImpl.java:241)
  at org.mockito.internal.creation.MockSettingsImpl.build(MockSettingsImpl.java:229)
  at org.mockito.internal.MockitoCore.mock(MockitoCore.java:62)
  ...
  Cause: org.mockito.exceptions.base.MockitoInitializationException: Could not initialize inline Byte Buddy mock maker. (This mock maker is not supported on Android.)
Are you running a JRE instead of a JDK? The inline mock maker needs to be run on a JDK.

Java               : 1.8
JVM vendor name    : Oracle Corporation
JVM vendor version : 25.221-b11
JVM name           : Java HotSpot(TM) 64-Bit Server VM
JVM version        : 1.8.0_221-b11
JVM info           : mixed mode
OS name            : Mac OS X
OS version         : 10.16
  at org.mockito.internal.creation.bytebuddy.InlineByteBuddyMockMaker.<init>(InlineByteBuddyMockMaker.java:170)
  at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
  at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
  at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
  at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
  at java.lang.Class.newInstance(Class.java:442)
  at org.mockito.internal.configuration.plugins.PluginInitializer.loadImpl(PluginInitializer.java:49)
  at org.mockito.internal.configuration.plugins.PluginLoader.loadPlugin(PluginLoader.java:57)
  at org.mockito.internal.configuration.plugins.PluginLoader.loadPlugin(PluginLoader.java:44)
  at org.mockito.internal.configuration.plugins.PluginRegistry.<init>(PluginRegistry.java:22)
  ...
  Cause: java.lang.IllegalStateException: No compatible attachment provider is available
  at net.bytebuddy.agent.ByteBuddyAgent.install(ByteBuddyAgent.java:597)
  at net.bytebuddy.agent.ByteBuddyAgent.install(ByteBuddyAgent.java:581)
  at net.bytebuddy.agent.ByteBuddyAgent.install(ByteBuddyAgent.java:533)
  at net.bytebuddy.agent.ByteBuddyAgent.install(ByteBuddyAgent.java:510)
  at org.mockito.internal.creation.bytebuddy.InlineByteBuddyMockMaker.<clinit>(InlineByteBuddyMockMaker.java:104)
  at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
  at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
  at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
  at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
  at java.lang.Class.newInstance(Class.java:442)
  ...

共有1个答案

杜晨朗
2023-03-14

这个问题是由于MacOSBigSur更新造成的,与我认为的根本原因相反(安装scala)。所以我在苹果论坛上解决了这个问题:https://developer.apple.com/forums/thread/666681

sudo rm -fr /Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin 
sudo rm -fr /Library/PreferencePanes/JavaControlPanel.prefpane
 类似资料:
  • 我已经在MacBook Air上安装了Big Sur。已安装Java,但Netbeans install表示未找到Java JDK。有人有解决这个问题的办法吗?

  • 逐步执行说明: https://cloud.google.com/sdk/docs/quickstart 解压存档 正在运行 收到此消息: 欢迎使用Google Cloud SDK! 就这些。 有什么办法让它工作吗?

  • 本文向大家介绍Python pip 安装与使用(安装、更新、删除),包括了Python pip 安装与使用(安装、更新、删除)的使用技巧和注意事项,需要的朋友参考一下 pip 是 Python 包管理工具,该工具提供了对Python 包的查找、下载、安装、卸载的功能。 pip检测更新 命令:pip list –outdated pip升级包 命令:pip install --upgrade pac

  • 我正在尝试使用NVM安装最新版本的node。我刚刚拿到了最新发布的带有M1芯片的硅Macbook Pro(不确定这是否相关)。我在app store上安装了xcode,在命令行上安装了xcode工具。我得到的主要错误是:

  • 我刚刚升级到优胜美地。我使用的是Apache 2.2,但升级包括2.4。在经历了一些配置噩梦之后,我最终使用Homebrew重新安装了2.4。我有它大部分配置。但是,当我使用PHP的旧httpd.conf设置时,我得到以下错误: 未找到符号:_unixd_config\n引用自:/usr/local/opt/php55/libexec/apache2/libphp5。因此\n应在:/usr/loc

  • 我在安装我创建的包时遇到问题。。。。 https://packagist.org/packages/mardy-git/redirect 据我所知,一切正常,我应该能够安装它。但是,当我运行composer安装或更新时,会收到以下错误消息。。。 在我的composer.json文件中,我有: 这是我今天下午创建的一个全新的包,我以前没有遇到过这样的问题,所以我不知道从哪里开始寻找解决方案。如果我删