• Register
0 votes

Problem :

My code works perfectly on my friend's laptop But throws below error on my laptop.

“Error: a jni error has occurred, please check your installation and try again”

I have tried running the code on a Eclipse Juno using Java 7. I have also tested it and also ran a lot of java programs on the laptop all works well. This is a only program which gives above error. This is related to my final year project and I need it to work on my laptop at any case, I will be very grateful to anyone who solves it.

by (3.9k points)  

1 Answer

0 votes

Solution :

Answer: Please right-click on a class that contains a main method. Click on the "Run As". Click on a "Java Application". A keyboard shortcut is: Shift+Alt+X J (while holding Shift and Alt, press the X; then release Shift and Alt and press the J).

Detailed Explanation: I am not 100% sure why above problem happens. It may be because of the use of a different jdk. I faced a same error. A solution was easier than I imagined. I was used to run my code using the Ctrl + F11. But when I ran it as the java application (the way I described in the "Answer"), my problem was resolved.

Hope it fixes your problem too!

by (36.1k points)