a jni error has occured

Clash Royale CLAN TAG#URR8PPP
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty margin-bottom:0;
up vote
2
down vote
favorite
I uninstalled Eclipse IDE due to this issue.
Then I tried to run java program in my Linux mint Terminal.
So I started with a small code
public class Myth
public static void main(Stringargs)
System.out.println("Hii There");
and run it by giving commands javac Myth.java
and java Myth but insted of giving output it gives the following error
Error: A JNI error has occurred, please check your installation and try again
Exception in thread "main" java.lang.UnsupportedClassVersionError: JVMCFRE003 bad major version; class=Myth, offset=6
at java.lang.ClassLoader.defineClassImpl(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:379)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:154)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:729)
at java.net.URLClassLoader.access$400(URLClassLoader.java:95)
at java.net.URLClassLoader$ClassFinder.run(URLClassLoader.java:1184)
at java.security.AccessController.doPrivileged(AccessController.java:732)
at java.net.URLClassLoader.findClass(URLClassLoader.java:604)
at java.lang.ClassLoader.loadClassHelper(ClassLoader.java:926)
at java.lang.ClassLoader.loadClass(ClassLoader.java:871)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:343)
at java.lang.ClassLoader.loadClass(ClassLoader.java:854)
at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:507)
linux-mint terminal java eclipse
add a comment |Â
up vote
2
down vote
favorite
I uninstalled Eclipse IDE due to this issue.
Then I tried to run java program in my Linux mint Terminal.
So I started with a small code
public class Myth
public static void main(Stringargs)
System.out.println("Hii There");
and run it by giving commands javac Myth.java
and java Myth but insted of giving output it gives the following error
Error: A JNI error has occurred, please check your installation and try again
Exception in thread "main" java.lang.UnsupportedClassVersionError: JVMCFRE003 bad major version; class=Myth, offset=6
at java.lang.ClassLoader.defineClassImpl(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:379)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:154)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:729)
at java.net.URLClassLoader.access$400(URLClassLoader.java:95)
at java.net.URLClassLoader$ClassFinder.run(URLClassLoader.java:1184)
at java.security.AccessController.doPrivileged(AccessController.java:732)
at java.net.URLClassLoader.findClass(URLClassLoader.java:604)
at java.lang.ClassLoader.loadClassHelper(ClassLoader.java:926)
at java.lang.ClassLoader.loadClass(ClassLoader.java:871)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:343)
at java.lang.ClassLoader.loadClass(ClassLoader.java:854)
at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:507)
linux-mint terminal java eclipse
add a comment |Â
up vote
2
down vote
favorite
up vote
2
down vote
favorite
I uninstalled Eclipse IDE due to this issue.
Then I tried to run java program in my Linux mint Terminal.
So I started with a small code
public class Myth
public static void main(Stringargs)
System.out.println("Hii There");
and run it by giving commands javac Myth.java
and java Myth but insted of giving output it gives the following error
Error: A JNI error has occurred, please check your installation and try again
Exception in thread "main" java.lang.UnsupportedClassVersionError: JVMCFRE003 bad major version; class=Myth, offset=6
at java.lang.ClassLoader.defineClassImpl(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:379)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:154)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:729)
at java.net.URLClassLoader.access$400(URLClassLoader.java:95)
at java.net.URLClassLoader$ClassFinder.run(URLClassLoader.java:1184)
at java.security.AccessController.doPrivileged(AccessController.java:732)
at java.net.URLClassLoader.findClass(URLClassLoader.java:604)
at java.lang.ClassLoader.loadClassHelper(ClassLoader.java:926)
at java.lang.ClassLoader.loadClass(ClassLoader.java:871)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:343)
at java.lang.ClassLoader.loadClass(ClassLoader.java:854)
at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:507)
linux-mint terminal java eclipse
I uninstalled Eclipse IDE due to this issue.
Then I tried to run java program in my Linux mint Terminal.
So I started with a small code
public class Myth
public static void main(Stringargs)
System.out.println("Hii There");
and run it by giving commands javac Myth.java
and java Myth but insted of giving output it gives the following error
Error: A JNI error has occurred, please check your installation and try again
Exception in thread "main" java.lang.UnsupportedClassVersionError: JVMCFRE003 bad major version; class=Myth, offset=6
at java.lang.ClassLoader.defineClassImpl(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:379)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:154)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:729)
at java.net.URLClassLoader.access$400(URLClassLoader.java:95)
at java.net.URLClassLoader$ClassFinder.run(URLClassLoader.java:1184)
at java.security.AccessController.doPrivileged(AccessController.java:732)
at java.net.URLClassLoader.findClass(URLClassLoader.java:604)
at java.lang.ClassLoader.loadClassHelper(ClassLoader.java:926)
at java.lang.ClassLoader.loadClass(ClassLoader.java:871)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:343)
at java.lang.ClassLoader.loadClass(ClassLoader.java:854)
at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:507)
linux-mint terminal java eclipse
asked Jul 20 at 5:42
Ujjwal Singh
6112
6112
add a comment |Â
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
1
down vote
accepted
This
java.lang.UnsupportedClassVersionError
means, that some of the libraries in your project are using diferrent version of java , and set accordingly in path.
Quick things to resolve this:
$>which java
output->location of current java (eg. /usr/bin/java)
java --version
output->1.7.0 or 1.8.0
if this is the case , try switching version, for this do the following:
export JAVA_HOME=<path to diff java version sdk>
export PATH=$JAVA_HOME/bin:$PATH
This allows new path to come in front of old path, also for eclipse specific errors, take a look at eclipse cache in home directory(.eclipse folder in your project). You may safely delete this directory along ith .project files if any and recompile.
Hope this helps!!
Edit: Offset=6 means your current version for java(JDK) is 1.6. Try switching it to later versions. Also check that you are using Jdk path and not jre path
after the commandjava --versionterminal gives the following outputJVMJ9VM007E Command-line option unrecognised: --version Error: Could not create the Java Virtual Machine. Error: A fatal exception has occurred. Program will exit.
â Ujjwal Singh
Jul 20 at 6:12
java -v, would also do it, there should be no spaces. If it is then your current java path is something like (/usr/java/jre1.x.y/) instead it should be (usr/java/jdk/1.x.y)
â Pavan Kate
Jul 20 at 6:16
my java path is/usr/java/jre1.8.0_171and after changing that the error is still active
â Ujjwal Singh
Jul 20 at 6:25
change it to /usr/java/jdk1.8.0_171 . If you dont have a jdk installed get it from oracle site by accepting icense agreement, its free. oracle.com/technetwork/java/javase/downloads/⦠see java jdk 1.8 u171, and download jdk
â Pavan Kate
Jul 20 at 6:30
1
Reinstalled jdk and now it is working . Thanks @PavanKate
â Ujjwal Singh
Jul 20 at 7:12
 |Â
show 6 more comments
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
down vote
accepted
This
java.lang.UnsupportedClassVersionError
means, that some of the libraries in your project are using diferrent version of java , and set accordingly in path.
Quick things to resolve this:
$>which java
output->location of current java (eg. /usr/bin/java)
java --version
output->1.7.0 or 1.8.0
if this is the case , try switching version, for this do the following:
export JAVA_HOME=<path to diff java version sdk>
export PATH=$JAVA_HOME/bin:$PATH
This allows new path to come in front of old path, also for eclipse specific errors, take a look at eclipse cache in home directory(.eclipse folder in your project). You may safely delete this directory along ith .project files if any and recompile.
Hope this helps!!
Edit: Offset=6 means your current version for java(JDK) is 1.6. Try switching it to later versions. Also check that you are using Jdk path and not jre path
after the commandjava --versionterminal gives the following outputJVMJ9VM007E Command-line option unrecognised: --version Error: Could not create the Java Virtual Machine. Error: A fatal exception has occurred. Program will exit.
â Ujjwal Singh
Jul 20 at 6:12
java -v, would also do it, there should be no spaces. If it is then your current java path is something like (/usr/java/jre1.x.y/) instead it should be (usr/java/jdk/1.x.y)
â Pavan Kate
Jul 20 at 6:16
my java path is/usr/java/jre1.8.0_171and after changing that the error is still active
â Ujjwal Singh
Jul 20 at 6:25
change it to /usr/java/jdk1.8.0_171 . If you dont have a jdk installed get it from oracle site by accepting icense agreement, its free. oracle.com/technetwork/java/javase/downloads/⦠see java jdk 1.8 u171, and download jdk
â Pavan Kate
Jul 20 at 6:30
1
Reinstalled jdk and now it is working . Thanks @PavanKate
â Ujjwal Singh
Jul 20 at 7:12
 |Â
show 6 more comments
up vote
1
down vote
accepted
This
java.lang.UnsupportedClassVersionError
means, that some of the libraries in your project are using diferrent version of java , and set accordingly in path.
Quick things to resolve this:
$>which java
output->location of current java (eg. /usr/bin/java)
java --version
output->1.7.0 or 1.8.0
if this is the case , try switching version, for this do the following:
export JAVA_HOME=<path to diff java version sdk>
export PATH=$JAVA_HOME/bin:$PATH
This allows new path to come in front of old path, also for eclipse specific errors, take a look at eclipse cache in home directory(.eclipse folder in your project). You may safely delete this directory along ith .project files if any and recompile.
Hope this helps!!
Edit: Offset=6 means your current version for java(JDK) is 1.6. Try switching it to later versions. Also check that you are using Jdk path and not jre path
after the commandjava --versionterminal gives the following outputJVMJ9VM007E Command-line option unrecognised: --version Error: Could not create the Java Virtual Machine. Error: A fatal exception has occurred. Program will exit.
â Ujjwal Singh
Jul 20 at 6:12
java -v, would also do it, there should be no spaces. If it is then your current java path is something like (/usr/java/jre1.x.y/) instead it should be (usr/java/jdk/1.x.y)
â Pavan Kate
Jul 20 at 6:16
my java path is/usr/java/jre1.8.0_171and after changing that the error is still active
â Ujjwal Singh
Jul 20 at 6:25
change it to /usr/java/jdk1.8.0_171 . If you dont have a jdk installed get it from oracle site by accepting icense agreement, its free. oracle.com/technetwork/java/javase/downloads/⦠see java jdk 1.8 u171, and download jdk
â Pavan Kate
Jul 20 at 6:30
1
Reinstalled jdk and now it is working . Thanks @PavanKate
â Ujjwal Singh
Jul 20 at 7:12
 |Â
show 6 more comments
up vote
1
down vote
accepted
up vote
1
down vote
accepted
This
java.lang.UnsupportedClassVersionError
means, that some of the libraries in your project are using diferrent version of java , and set accordingly in path.
Quick things to resolve this:
$>which java
output->location of current java (eg. /usr/bin/java)
java --version
output->1.7.0 or 1.8.0
if this is the case , try switching version, for this do the following:
export JAVA_HOME=<path to diff java version sdk>
export PATH=$JAVA_HOME/bin:$PATH
This allows new path to come in front of old path, also for eclipse specific errors, take a look at eclipse cache in home directory(.eclipse folder in your project). You may safely delete this directory along ith .project files if any and recompile.
Hope this helps!!
Edit: Offset=6 means your current version for java(JDK) is 1.6. Try switching it to later versions. Also check that you are using Jdk path and not jre path
This
java.lang.UnsupportedClassVersionError
means, that some of the libraries in your project are using diferrent version of java , and set accordingly in path.
Quick things to resolve this:
$>which java
output->location of current java (eg. /usr/bin/java)
java --version
output->1.7.0 or 1.8.0
if this is the case , try switching version, for this do the following:
export JAVA_HOME=<path to diff java version sdk>
export PATH=$JAVA_HOME/bin:$PATH
This allows new path to come in front of old path, also for eclipse specific errors, take a look at eclipse cache in home directory(.eclipse folder in your project). You may safely delete this directory along ith .project files if any and recompile.
Hope this helps!!
Edit: Offset=6 means your current version for java(JDK) is 1.6. Try switching it to later versions. Also check that you are using Jdk path and not jre path
answered Jul 20 at 6:02
Pavan Kate
263
263
after the commandjava --versionterminal gives the following outputJVMJ9VM007E Command-line option unrecognised: --version Error: Could not create the Java Virtual Machine. Error: A fatal exception has occurred. Program will exit.
â Ujjwal Singh
Jul 20 at 6:12
java -v, would also do it, there should be no spaces. If it is then your current java path is something like (/usr/java/jre1.x.y/) instead it should be (usr/java/jdk/1.x.y)
â Pavan Kate
Jul 20 at 6:16
my java path is/usr/java/jre1.8.0_171and after changing that the error is still active
â Ujjwal Singh
Jul 20 at 6:25
change it to /usr/java/jdk1.8.0_171 . If you dont have a jdk installed get it from oracle site by accepting icense agreement, its free. oracle.com/technetwork/java/javase/downloads/⦠see java jdk 1.8 u171, and download jdk
â Pavan Kate
Jul 20 at 6:30
1
Reinstalled jdk and now it is working . Thanks @PavanKate
â Ujjwal Singh
Jul 20 at 7:12
 |Â
show 6 more comments
after the commandjava --versionterminal gives the following outputJVMJ9VM007E Command-line option unrecognised: --version Error: Could not create the Java Virtual Machine. Error: A fatal exception has occurred. Program will exit.
â Ujjwal Singh
Jul 20 at 6:12
java -v, would also do it, there should be no spaces. If it is then your current java path is something like (/usr/java/jre1.x.y/) instead it should be (usr/java/jdk/1.x.y)
â Pavan Kate
Jul 20 at 6:16
my java path is/usr/java/jre1.8.0_171and after changing that the error is still active
â Ujjwal Singh
Jul 20 at 6:25
change it to /usr/java/jdk1.8.0_171 . If you dont have a jdk installed get it from oracle site by accepting icense agreement, its free. oracle.com/technetwork/java/javase/downloads/⦠see java jdk 1.8 u171, and download jdk
â Pavan Kate
Jul 20 at 6:30
1
Reinstalled jdk and now it is working . Thanks @PavanKate
â Ujjwal Singh
Jul 20 at 7:12
after the command
java --version terminal gives the following output JVMJ9VM007E Command-line option unrecognised: --version Error: Could not create the Java Virtual Machine. Error: A fatal exception has occurred. Program will exit.â Ujjwal Singh
Jul 20 at 6:12
after the command
java --version terminal gives the following output JVMJ9VM007E Command-line option unrecognised: --version Error: Could not create the Java Virtual Machine. Error: A fatal exception has occurred. Program will exit.â Ujjwal Singh
Jul 20 at 6:12
java -v, would also do it, there should be no spaces. If it is then your current java path is something like (/usr/java/jre1.x.y/) instead it should be (usr/java/jdk/1.x.y)
â Pavan Kate
Jul 20 at 6:16
java -v, would also do it, there should be no spaces. If it is then your current java path is something like (/usr/java/jre1.x.y/) instead it should be (usr/java/jdk/1.x.y)
â Pavan Kate
Jul 20 at 6:16
my java path is
/usr/java/jre1.8.0_171 and after changing that the error is still activeâ Ujjwal Singh
Jul 20 at 6:25
my java path is
/usr/java/jre1.8.0_171 and after changing that the error is still activeâ Ujjwal Singh
Jul 20 at 6:25
change it to /usr/java/jdk1.8.0_171 . If you dont have a jdk installed get it from oracle site by accepting icense agreement, its free. oracle.com/technetwork/java/javase/downloads/⦠see java jdk 1.8 u171, and download jdk
â Pavan Kate
Jul 20 at 6:30
change it to /usr/java/jdk1.8.0_171 . If you dont have a jdk installed get it from oracle site by accepting icense agreement, its free. oracle.com/technetwork/java/javase/downloads/⦠see java jdk 1.8 u171, and download jdk
â Pavan Kate
Jul 20 at 6:30
1
1
Reinstalled jdk and now it is working . Thanks @PavanKate
â Ujjwal Singh
Jul 20 at 7:12
Reinstalled jdk and now it is working . Thanks @PavanKate
â Ujjwal Singh
Jul 20 at 7:12
 |Â
show 6 more comments
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f457340%2fa-jni-error-has-occured%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password