Toolbox for Java and JTOpen

Turning off the JIT

How do I turn off the JIT?

Java's exception stack traces are an extremely useful debugging aid. They can often expedite problem determination in your own code, and certainly help when reporting problems to others. Part of the stack trace which is most useful are the line numbers. The following stack trace shows a complete call stack along with line numbers:

com.ibm.as400.access.AS400SecurityException: Signon was canceled.
at com.ibm.as400.access.AS400.getSecurity400(AS400.java:1406)
at com.ibm.as400.access.AS400.signOn(AS400.java:2423)
at com.ibm.as400.access.AS400.connect(AS400.java:626)
at com.ibm.as400.access.AS400JDBCConnection.setProperties(
AS400JDBCConnection.java:1465)
at com.ibm.as400.access.AS400JDBCDriver.initializeConnection(
AS400JDBCDriver.java:423)
at com.ibm.as400.access.AS400JDBCDriver.connect(
AS400JDBCDriver.java:231)
at java.sql.DriverManager.getConnection(DriverManager.java:457)
at java.sql.DriverManager.getConnection(DriverManager.java:159)
at QueryCustomer.main(QueryCustomer.java:20)

Sometimes, the line numbers are replaced with the phrase "Compiled Code". If this is true, the stack trace is not as useful for debugging:

com.ibm.as400.access.AS400SecurityException: Signon was canceled.
at com.ibm.as400.access.AS400.getSecurity400(Compiled Code)
at com.ibm.as400.access.AS400.signOn(Compiled Code)
at com.ibm.as400.access.AS400.connect(Compiled Code)
at com.ibm.as400.access.AS400JDBCConnection.setProperties(Compiled Code)
at com.ibm.as400.access.AS400JDBCDriver.initializeConnection(Compiled Code)
at com.ibm.as400.access.AS400JDBCDriver.connect(Compiled Code)
at java.sql.DriverManager.getConnection(Compiled Code)
at java.sql.DriverManager.getConnection(Compiled Code)
at QueryCustomer.main(Compiled Code)

The primary reason that line numbers are missing from the stack trace is that the JIT (Just In Time) compiler is enabled. In most environments, the JIT compiler is enabled by default in order to maximize performance. However, it is desirable to turn the JIT off during debugging, so that stack traces include line numbers.

Different environments provide different mechanisms for turning off the JIT. Here are some of the most common scenarios.

Applications using JDK 1.1.5 and previous (Windows)

Use the -nojit option when running the java command. Example:
java -nojit QueryCustomer Lee Jeff

Applications using JDK 1.1.6 and later (Windows) or any non-Windows JDK

Set the JAVA_COMPILER environment variable to point to a non-existent JIT compiler, e.g. "nojit".

To turn off the JIT in the existing DOS prompt only (Windows):
set JAVA_COMPILER=nojit

To permanently turn off the JIT in Windows 95, add the above line to your AUTOEXEC.BAT file. In Windows NT, use the System Environment GUI to set the environment variable.

For other platforms, set the JAVA_COMPILER environment variable accordingly.

Applets in Netscape Communicator 4.x (Windows)

Rename or delete the file JIT3240.DLL found in C:Program FilesNetscapeCommunicatorJavaBin.

Applets in Microsoft Internet Explorer 4.x (Windows)

Un-check the "Java JIT compiler enabled" setting located in the "Java VM" section of the Internet Explorer preferences. The preferences can be found by following the pull-down menus: View -> Internet Options -> Advanced.

Contact an IBM Sales Specialist

Browse Power Systems

Next generation applications for big data and analytics and cognitive computing are providing unprecedented insights into opportunities, threats and efficiencies. IBM Power Systems is at the forefront of delivering solutions to gain faster insights from analyzing both structured information and unstructured big data. With the secure, flexible and open platform of IBM Power Systems plus solutions and software, organizations can outpace their competitors by delivering faster services, providing differentiated offerings and turning operational cost into investment opportunity.

To draw insights and make better decisions, businesses rely on the secure, flexible and open platform of IBM Power Systems. Built with the first processor designed for big data workloads, the design of Power Systems combines the computing power, memory bandwidth and I/O in ways that are easier to consume and manage, building on strong resiliency, availability and security.

IBM Power Systems deliver flexibility and choice of operating systems to enable your business to support the next generation applications for big data and analytics and cognitive computing that are transforming how organizations work today. Whether running 1, 2, or all 3 - coupled with PowerVM, they maximize the benefit of Power Systems in your business.

Transform your business with Systems Software that enables virtualization, high availability, flexibility, security and compliance on Power Systems™. IBM’s integrated approach to developing Systems and Systems Software together delivers optimized results with Power Systems.

As an open innovation platform, Power Systems is optimized for big data and analytics performance and to deliver scale-out economics and security for the cloud. IBM and IBM Business Partner solutions exploit key capabilities in IBM Power Systems.

Over the last five years thousands of clients have migrated to IBM Power Systems for choice and flexibility. Learn how Power Systems has helped them revolutionise the way IT is developed and delivered, optimise for big data and analytics, and support private, public and hybrid offerings for scale-out or scale-up implementations all while improving business performance, reducing risk, and establishing a platform for growth.