[Java] [Android] Javah Jni encounters a workaround for class not found

Source: Internet
Author: User

========================================================
Qiujuer
Blog: Blog.csdn.net/qiujuer
website: www.qiujuer.net
Open Source Library: genius-android
Reprint Please specify Source: http://blog.csdn.net/qiujuer/article/details/41644075
========================================================

A few days ago used to get a JNI, when using Javah to generate the corresponding . h file appears: " Error: Class Android.graphics.Bitmap not found"

After a while to get it done, here for you to share.


To solve this problem, we have to look at my entire process.

When I met this, the first reaction was that Java did not contain Java files in the Android SDK .

Then find the Android SDK directory, locate the platforms folder, go to "android-20", and then find the "android.jar" file, Add it to the CLASSPATH of the computer environment variable.



After the configuration is ready, rerun:

Javah-classpath. -jni net.qiujuer.genius.app.NlurNative


I wipe, or not!

Later, after a half-day, even the Android.jar decompression to add to the environment variables, but still not.

Depressed, and finally finished, in fact, there are errors on the statement:

javah-classpath.-jni net.qiujuer.genius.app.NlurNative Delete "-classpath. "

Javah-jni net.qiujuer.genius.app.NlurNative a successful operation:


Javah-classpath.-jni . This is found on the internet, it seems there are a lot of errors on the Internet, to use caution !


Dedication to everyone, hope to help you!

[Java] [Android] Javah Jni encounters a workaround for class not found

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.