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 IBM

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.

IBM Power Systems hardware is at the heart of enabling major business and industry transformations fueled by the explosive growth of big data and analytics. Power Systems help organizations drive faster business insights with industry leading performance, scalability and virtualization flexibility.

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.

IBM's integrated approach to developing Systems and Systems Software stacks together delivers a platform that supports next generation applications for big data and analytics and cognitive computing on an open platform for choice while providing maximum utilization, availability, and flexibility to help you deliver new advantages to your business.

IBM and IBM Business Partner solutions exploit key benefits in IBM Power Systems’ unique design combined with systems software to provide support for next generation applications for big data and analytics and cognitive computing to providing unprecedented insights into opportunities, threats and efficiencies to your organization.


Over the last five years thousands of clients have migrated to IBM Power Systems. Learn how Power Systems has helped them support next generation applications for big data and analytics and cognitive computing on an open platform for choice while improving business performance, reducing risk, and establishing a platform for growth.