Copy and paste the following into your blog description:

<script src="https://cdn.rawgit.com/google/code-prettify/master/loader/run_prettify.js"></script>

Use the following <pre/> tags in any of your Tumblr posts:

<pre class="prettyprint">
    Many
    lines
    of
    code
</pre>

After you’re done your code should look beautiful like this example:

package com.schimmelmann.us.example;

class HelloWorld {
    private static final String HELLO_WORLD = "Hello World!";
    
    public static void main(String[] args) {
        System.out.println(HELLO_WORLD);
    }
}

Source: https://github.com/google/code-prettify