我在Eclipse的Android虚拟设备上运行应用程序时遇到问题。当我尝试运行我的项目时,出现此错误:
Errors occurred during the build.
Errors running builder 'Android Package Builder' on project 'AddingNumbers'.
sun/misc/BASE64Encoder
日志文件是这样的:
!ENTRY org.eclipse.core.resources 4 566 2018-08-24 18:38:43.274
!MESSAGE Errors occurred during the build.
!SUBENTRY 1 com.android.ide.eclipse.adt 4 75 2018-08-24 18:38:43.275
!MESSAGE Errors running builder 'Android Package Builder' on project 'AddingNumbers'.
!STACK 0
java.lang.NoClassDefFoundError: sun/misc/BASE64Encoder
at com.android.sdklib.internal.build.SignedJarBuilder.<init>(SignedJarBuilder.java:177)
at com.android.sdklib.build.ApkBuilder.init(ApkBuilder.java:446)
at com.android.sdklib.build.ApkBuilder.<init>(ApkBuilder.java:422)
at com.android.sdklib.build.ApkBuilder.<init>(ApkBuilder.java:362)
at com.android.ide.eclipse.adt.internal.build.BuildHelper.finalPackage(BuildHelper.java:391)
at com.android.ide.eclipse.adt.internal.build.BuildHelper.finalDebugPackage(BuildHelper.java:359)
at com.android.ide.eclipse.adt.internal.build.builders.PostCompilerBuilder.build(PostCompilerBuilder.java:632)
at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:735)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:206)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:330)
at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:405)
at org.eclipse.core.internal.resources.Project$1.run(Project.java:566)
at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2240)
at org.eclipse.core.internal.resources.Project.internalBuild(Project.java:544)
at org.eclipse.core.internal.resources.Project.build(Project.java:120)
at com.android.ide.eclipse.adt.internal.project.ProjectHelper.doFullIncrementalDebugBuild(ProjectHelper.java:1143)
at com.android.ide.eclipse.adt.internal.launch.LaunchConfigDelegate.launch(LaunchConfigDelegate.java:155)
at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:885)
at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:739)
at org.eclipse.debug.internal.ui.DebugUIPlugin.buildAndLaunch(DebugUIPlugin.java:1039)
at org.eclipse.debug.internal.ui.DebugUIPlugin$8.run(DebugUIPlugin.java:1256)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:56)
我尝试安装Java 8而不是Java 10,并从Window-> Preferences-> Java-> Installed jres中选择jre1.8.0_181
如何解决此问题?
答案 0 :(得分:-1)
使用eclipse.ini
的以下选项编辑-vmargs
文件,
-vm
/usr/lib/jvm/java-8-openjdk-amd64/bin