aspose file tools*
The moose likes Beginning Java and the fly likes A JNI error has occurred Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "A JNI error has occurred" Watch "A JNI error has occurred" New topic
Author

A JNI error has occurred

Kalege Enock
Greenhorn

Joined: Nov 01, 2008
Posts: 3
Hi I'm new to JAVA programming, leaning GUI and event-driven programing. I got this error please assist.

--------------------Configuration: <Default>--------------------
java.lang.NoSuchMethodError: main
Error: A JNI error has occurred, please check your installation and try again
Exception in thread "main"
Process completed.

Thanks
Kalege Enock
Greenhorn

Joined: Nov 01, 2008
Posts: 3
I am using JCreator version 4.50.010
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 39436
    
  28
Nothing to do with using JCreator; you need to check the heading for your main method. It should read

public static void main(String[] args)

and there is very little variation permitted. The JVM looks for a method with that heading, and even the slightest spelling error (eg Main) will prevent it from finding it.

See whether that works.
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 39436
    
  28
And welcome to JavaRanch
Kalege Enock
Greenhorn

Joined: Nov 01, 2008
Posts: 3
Hi Campbell Ritchie,
Thank you for a welcome note and support. The error is resolved.
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 39436
    
  28
Well done
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: A JNI error has occurred