Java, IllegalFormatConversionException when importing an SSL certificate

Today I faced a strange problem. I needed to import an SSL certificate in a java keystore, using the “classic” keytool command. I was sure that the format of the certificate was correct, but I always received the following error:

java.util.IllegalFormatConversionException: d != java.lang.String

java-keystore01

The reason of the error is that – in the latest versions of java – by default the keytool command uses the language of the system (in my case italian).

I had to add the parameter -J-Duser.language=en to the keytool command to made it work correctly:

java-keystore02

Atari Now Runs Java, Thankfully Doesn’t Require Constant Updates

Java Grinder is a tool that compiles Java programs to run on platforms like microcontrollers and consoles, by outputting native assembly code and using APIs to work with custom hardware like bespoke graphics and sound chips. Amongst other hardware, Java Grinder supports the Commodore 64, which uses a variant of the 6502 CPU. [Michael Kohn] realized the Atari 2600 shares this processor, and figured he’d get started on making Java Grinder work with the Atari by expanding on the C64 work done by [Joe Davisson]. Together, they brought Java to the Atari 2600 and made a game along the way.

According to [Michael], parts of the project were easy, as some Java routines compile down into as little as 1 or 2 instructions on the 6502. Other parts were harder, like dealing with the graphics subsystem, and modifying Java Grinder to output 8-bit bytecode to fit into the Atari’s tiny 4K ROM limit. Even with this tweak, they still couldn’t fit in a game and title screen. In the end they relied on bank switching to get the job done. [Joe]’s game is pretty solid fare for the Atari 2600 — blocky graphics and bleepy sounds — and they’ve uploaded it to the page so you can try it yourself in an emulator.

At the end of the day, porting Java code to a system with 128 bytes of RAM probably isn’t going to be particularly useful. However, as a coding exercise and learning experience, there’s a lot of value here in terms of building your skills as a coder. Other such experiments have shown us Java running on other unexpected devices, like the Sega Genesis or the MSP430. Video after the break.


Filed under: classic hacks

Brew a Cup of Coffee Without Electricity!

So, wether you’ve blown your house’s breakers while cranking up the power on your latest project or a storm has brought low the local power grid, what do you do if you desperately need coffee with no electricity to power your coffee maker? Make like [austiwawa]: crack it open and bust out the tea lights.

Removing the bottom of the coffee maker is simply done, exposing the resistance heating element. Improvising a jig to hold the coffee maker over an arrangement of five tea lights, the candle flames slowly do the work of heating the element to set the maker in motion.

It’s a solution for after the apocalypse… as long as you can find tea lights, coffee plus a grinder, and for some reason don’t want to use the quick and efficient method of brewing over an actual fire (though kitchen hearths are a rarity these days). Now we kind of want to see this adapted for all kinds of other heat sources. Reflected sunlight anyone?

As you can imagine, this takes significantly longer to brew your coffee — [austiwawa] doesn’t tell us how long it took — but sometimes beggars can’t be choosers. For more power-friendly means to fueling up, check out this quartet of Hackaday approved coffee hacks.

[Thanks for the tip, Austin!]


Filed under: cooking hacks, misc hacks