Well I am a huge fan of the Java programming language. I
have done a fair bit of coding in C in my college days and although it is a
beautiful programming language, once you exceed a certain amount of lines of
code, you are going to start experiencing issues because of the sheer volume of
the program size. And if you get a segmentation fault in C, you are done for
the day. You will spend the whole day putting printf statements everywhere just
to identify why things got messed up. I have been there, done that. The
advantage of Java was that it came up with a lot of cool features being an
object oriented language and made life easy for programmers like me. I
particularly like exception handling since it made handling runtime exceptions
easy to manage. But yes, as time passed, Java is now so huge that at times you
do get frustrated when you meet some errors that make no sense whatsoever.
On Monday I decided to install ODI on my laptop since I
wanted to have a look at it and do some messing around with it. Oracle has made
it easy to download and do install. So I went ahead and downloaded all the
necessary files. I also downloaded the environment setup files just to be able
to do the installation of that as well. Now once I finished the file downloads,
which were jar files, I ran this simple command to run the jar files.
And as soon as I ran it, I got an error that says “Unsupported
major.minor version 51.0
Now, the catch is that this exception although it gives a
lot of information, misses out one crucial thing, it does not say exactly what
the problem is.
So, I turned to Google and found that this issue is because
of mismatch of the JRE environment that is used for compiling the jar file.
Since I was using JDK 1.6, it gave an error since the jar files we compiled for
JRE 1.7 onwards.
Next step, uninstall the JDK 1.6 and install either 1.7 or
1.8. So back to the inter web downloading the files and installing the
necessary software and configuring them.
Again I tried running it, and again the same issue. Now it
started getting on my nerves since I had already done the uninstall and I had
installed all the necessary versions of JDK…
Also, running java –version command gives that I have 1.8
installed and still it is not happening…
Then I happened to look at the folder from which I was
running the java command… It still pointed to 1.6…Apparently, even if I do the
uninstall for the JDK 1.6 the folder still remained for some reason…
I changed the folder to 1.8, ran the same command and voila,
it started to run…
The thing to realize after this mammoth syntax check
exercise is fairly simple:-
- No matter what exception you catch, it should be explained in a simple way. I am still trying to get my head around what is major and minor and what is 51.0 in the exception…Something as simple as “JRE version mismatch not compatible” would have worked just fine
- Exceptions are written to handle runtime exceptions and generally, we will not have access to the code structure… So no matter if I know which line is affected, without access to the source code, it is still Greek and Latin to me…
Still got it to work… Another good day comes to an end…
No comments:
Post a Comment