Java Compiler Defect when compiling with Java Compliance level.

0 Comments | This entry was posted on Feb 06 2012 by mchrisman

I recently came across an interesting little bug with the Java compiler. On my Maximo development environment, I have Eclipse installed with Java 1.6. I use the compiler compliance level to make class files for both Maximo 7 (which is Java 1.5) and Maximo 6 (which is Java 1.4). However, when working on a class file for 1.4 level, I had the following lines of code.

String color = “blue”;
color = color.replace(“e”,”u”);

The above lines of code compiles without error and when tested on a JVM 1.5 or higher, runs without error. However, when I try to run this on a JVM 1.4, I get the error:

Method not found “color.replace”

This was a bit of a surprise to me since I know that replace does exist for JVM 1.4. After a bit of research I found my problem. (Bonus points if you can see it.) The problem is that in JVM 1.4, the only replace method for the String object only takes chars not strings. Java added the strings version in 1.5. I understand my bug and was easy to fix. What got me was that the compiler did not catch it, even though it was supposed to be making sure my end class was was 1.4 compliant.

Moral of the store is watch carefully when you are using Java compliance levels on your projects. It might not be doing such a good job for you.

PM forecast logic for Time-Based PMs

0 Comments | This entry was posted on Feb 06 2012 by mchrisman

Here is an article on how the estimated Next Due Date is calculated.

PM forecast logic for Time-Based PMs

Hard and Soft Reservations in Maximo 7.5

0 Comments | This entry was posted on Feb 06 2012 by mchrisman

Here is an article on how to use hard and soft reservations in Maximo.

Hard and Soft Reservations in Maximo 7.5

Crontask in cluster environment cause continuous duplicate values error in Crontaskhistory table

0 Comments | This entry was posted on Feb 06 2012 by mchrisman

Here is an article on how to resolve an error when running crontasks in a clustered environment.

Crontask in cluster environment cause continuous duplicate values error in Crontaskhistory table

How to enable SMS messages and secondary email addresses in Maximo

0 Comments | This entry was posted on Jan 20 2012 by mchrisman

Here is an article on how to enable SMS messages and secondary email addresses in Maximo

SMS messages and secondary email addresses in Maximo

How to fix when Direct Print is not working after Security Update for Windows Internet Explorer 8

0 Comments | This entry was posted on Jan 20 2012 by mchrisman

Here is an article on how to fix the problem with Direct Print after a Security Update has been applied to IE.

Direct Print is not working after Security Update for Windows Internet Explorer 8

How to designate a location as a repair location

0 Comments | This entry was posted on Jan 20 2012 by mchrisman

Here is an article on how to enable repair facilities and then assign a location as a repair location.

Enabling Repair Facilities

How to install Weblogic 9 as a service on Windows

0 Comments | This entry was posted on Jan 20 2012 by mchrisman

Here is an article on how to install Weblogic 9 as a service on Windows

Installing Weblogic 9 as a Service

How to install Weblogic 10 as a Service on Windows

0 Comments | This entry was posted on Jan 20 2012 by mchrisman

Here is an article on how to install Weblogic 10 as a service on Windows.

Installing Weblogic 10 as a Service

How to change the size of image on Login Page

0 Comments | This entry was posted on Jan 20 2012 by mchrisman

Here is an article on how to change the size of an image on the login page.

Changing the size of image on Login Page