I love using
gedit to make changes to config files in Linux. However, I have recently encountered some odd issues where config files that I edit using
gedit just don’t work properly. However, making the exact same changes with
vim does not have any issues.
Looking at both files (one edited with
gedit, the other with
vim), they look exactly the same…so I thought. Apparently,
gedit likes to add a
\r (carriage return) to the end of some lines. This is a hidden character, so if you open the file with
vi/vim, you won’t see it. However, this hidden character can cause a very nasty side effect to your config files in that some applications will not properly parse the file. As a result, your application (or OS) will not work (talk about a great way to perform a nasty DoS attack).
This is the type of problem that will make you pull your hair out trying to solve. So, the solution? Either use
nano. If you use
gedit, make sure you do a find and replace where you want to find “
\r” and leave the replace textbox blank. This will remove all instances of
\r. Your file will “look” exactly the same, however, you eliminated that pesky hidden carriage return character causing all the problems.
, not working
, Red Hat
For Java apps to run in Windows, a JRE (Java Runtime Environment) must be installed. If it’s installed, but your Java apps are throwing errors that it cannot find the JRE, then you will need to add an environment variable to point to the Java bin directory.
Here is a screenshot of such an error I received when trying to run the Android SDK:
(Also notice the typo in the above message: “Checking it it’s installed in …”)
Below are instructions for fixing this error on Windows 7 x64 with the 64-bit JRE installed:
- Click the “Start Orb”, and type:
- In the search results, you should see “System” appear. Click on it, and you should have the “View basic information about your computer window” appear.
- In that window, on the left hand side, you should see a link to “Advanced system settings”. Click it. (Accept all UAC prompts)
- The “System Properties” window will appear. Click the “Advanced” tab.
- On the “Advanced” tab, click the button towards the bottom of the window titled “Environment Variables…”
- The “Environment Variables” window should appear. In this window, on the bottom half, you should see a section titled: “System variables”. Scroll down that list for an entry titled:
Path. Click the “Edit” button.
- The “Edit System Variable” window should appear. In this window, select the textbox for “Variable value:”. Scroll to the end of the entry, and add a semicolon (;) to the end of the line (assuming no semicolon is currently there).
- You will then need to locate where your Java bin directory is located. For me, on 64-bit Windows 7 with the 64-bit JRE installed, it is located in the following path:
C:\Program Files\Java\jre6\bin (This is the default location if installing the 64-bit JRE)
- Copy and paste the path to the bin directory after the semicolon we just added to the “Variable value:” textbox.
- Click OK to all the windows, and your application should work.
Tags: 64 bit
, Windows 7