Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Java Local Development Environments Exploring Your IDE Clean up this mess

Reformatting my code in IntelliJ isn't working.

So as far as I can see I've try everything. Obviously I haven't otherwise I wouldn't be here though :D.

So I press Crtl + Alt + L and I get a yellow box in my editor that says: "No lines changed: content is already properly formatted Show reformat dialog: Ctrl+Alt+Shift+L".

Show reform dialog is a link, that shows me I am reformatting Messy.java. I've also clicked on just about every other folder in the project and tried reformatting it there.

Crtl + ALt + Shift + L doesn't actually seem to do anything and when I right click on Messy.java in the src folder on the left hand side the reformat code option is greyed out. Maybe I have something set up wrong?

Another question if anyone knows. The hot key for commenting lines doesn't work, I am running elementary OS, a distro based on Ubuntu. It shouldn't make a big difference what keymap I'm using because the commenting key is Crtl + / for every one as far as I can tell.

Thanks in advance!

1 Answer

Solved thanks to my trusty rubber ducky. I guess Messy.java got mapped to being a text file. So even after I deleted the project, remade it, and tried to make it a java class file intelliJ still recognized anything and everything called Messy.java as a text file.