Caused by java lang classnotfoundexception sun misc base64encoder

Error about sun/misc/BASE64Encoder on Eclipse

As others have pointed out already, this is a compatibility issue—you need exactly Java 8 to run Eclipse.

  • Install JDK 8 if you don’t have it already.
  • In Eclipse, go to Window > Preferences > Installed JREs. Make sure Java 8 appears in the list and is selected. After that, close Eclipse.
  • Additionally, eclipse.ini also has a reference to the Java VM it uses. Make sure the VM it points to is Java 8 (see link on how to find it and how to set VM preferences).
  • Restart Eclipse and try again.

Solution 2

The Android code you are using is trying to use the sun.misc.BASE64Encoder class.

This deprecated class has been removed from Java 9 so this is not going to work.

You will need to switch back to Java 8 or find an update to the Android code (if there is one).

Solution 3

I’m working with Windows 7. I had to change the preferences and the ini file. Both had C:\Program Files\Java\jdk-12.0.1\bin which I changed to C:\Program Files\Java\jre1.8.0_221\bin. It now works!

Zoe

Comments

enter image description here

when i run my app in mac, and show up this message Errors occurred during the build. Errors running builder ‘Android Package Builder’ on project ‘IMPEXP’. sun/misc/BASE64Encoder but this project is work fine in windows 10 computer, and i don’t use any about base64Encoder eclipse Version: Photon Milestone 3 (4.8.0M3) JRE java se 9.0 edit! i found something like below

!ENTRY org.eclipse.core.resources 4 2 2017-11-09 11:50:09.047 !MESSAGE Problems occurred when invoking code from plug-in: "org.eclipse.core.resources". !STACK 0 java.lang.NoClassDefFoundError: sun/misc/BASE64Encoder at com.android.sdklib.internal.build.SignedJarBuilder.(SignedJarBuilder.java:177) at com.android.sdklib.build.ApkBuilder.init(ApkBuilder.java:446) at com.android.sdklib.build.ApkBuilder.(ApkBuilder.java:422) at com.android.sdklib.build.ApkBuilder.(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) Caused by: java.lang.ClassNotFoundException: sun.misc.BASE64Encoder cannot be found by com.android.ide.eclipse.base_23.0.7.2120684 at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:484) at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:395) at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:387) at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:150) at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:496) . 23 more 

greg-449

Look in the .log file in the workspace .metadata directory to see if there is a more detailed message.

greg-449

,metadata is a folder in you workspace. Folders starting with ‘.’ are hidden so Finder won’t show them. You can see it in Terminal using the ls -a command. Inside .metadata is a file called .log, again this is hidden. Terminal commands such as less can display it. You can also use the ‘Error Log’ view in Eclipse.

Читайте также:  All unchecked exceptions in java

Источник

Saved searches

Use saved searches to filter your results more quickly

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.

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not usable anymore #1

Not usable anymore #1

Comments

I did a tutorial that used your repository in one step. But an error occurred:

Exception in thread «main» java.lang.NoClassDefFoundError: sun/misc/BASE64Encoder at com.android.signapk.SignApk.addDigestsToManifest(SignApk.java:169) at com.android.signapk.SignApk.main(SignApk.java:325) Caused by: java.lang.ClassNotFoundException: sun.misc.BASE64Encoder at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:602) at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178) at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)

I read somewhere that this error is caused by using outdated libraries, and since you did not attach the .java files to the repo, I am not sure and cannot fix it.

I think that it this tool worked quite well with the old java versions. It’s just unfortunate that this and all the forks are not compatible with the newer java versions (I didn’t check the exact version).

The text was updated successfully, but these errors were encountered:

Источник

Оцените статью