Folder org already exists/Too many open files with Netbeans

Linux, Netbeans No Comments »

The messages “Folder org already exists in …” and “Too many open files” when using Netbeans are likely related. The underlying error might be that Linux runs out of file descriptors, which can happen rather quickly when you open many projects at once. Here’s the solution.

The file descriptors can be set at the system level and at the shell level:

Check how many your system allows:

cat /proc/sys/fs/file-max

This value can be set to a high number, probably to several 100k without major issues. For now you might try:

echo “65536″ >/proc/sys/fs/file-max

You could also add

fs.file-max = 65536

to

/etc/sysctl.conf

then run

sysctl -p

to reload sysctl.conf

For the shell type

ulimit -n

to get the number of file descriptors.

You can set for example

* soft nofile 8192
* hard nofile 8192

in

/etc/security/limits.conf

to increase the number.

After increasing these values I have not had any issues with Netbeans as described above for several months now. Hope it helps.

=-=-=-=-=
Powered by Bilbo Blogger

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]

Editing less (less css) with Netbeans IDE

CSS, Linux, Netbeans 2 Comments »

Just a little tip, as the syntax of less (less css) is so similar to css, just add a new file type in Netbeans > Tools > Options > Miscellaneous > Files like so:

Btw, setting an image size in Bilbo after adding the image crashes Bilbo, but only after the post was saved locally. So add your images first, then “Save Locally” before this bug is fixed.

=-=-=-=-=
Powered by Bilbo Blogger

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]

Netbeans Regular Expressions Find and Replace

Netbeans, Programming, Quanta Plus No Comments »

Powerful find and replace with regular expressions should be the hallmark of every IDE worth its mettle. MS Visual Studio does it so-so, but lo and behold, Netbeans (at least in version 6.1) is even worse.

So I wanted to put foo at the beginning of every line in a text, which calls for a regex like:

^.*

and replace like:

foo $0

However, Netbeans only ever replaces the first match in a text, over and over again. It also hangs up easily in the process.

As with many a Netbeans quirk, it’s Quanta Plus to the rescue again:

Quanta_plus_utf-10

Works like a charm.

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]

UTF-8 Encoding in Netbeans Editor on Linux

Linux, Netbeans No Comments »

The Netbeans 6.1 editor seems to have problems displaying UTF-8 encoded files (Linux Mint Daryna, Ubuntu Feisty), so a source file with Thai (and probably Chinese, Japanese etc.) will look like this if project encoding is set to UTF-8:

Netbeans_utf-8

Changing font, project properties etc. won’t help, so before messing around to much and risking possible data corruption, here’s a workaround: Use Quanta Plus for editing, a fantastic editor I find myself using more and more and which hasn’t let me down. Here’s the section in Quanta Plus:

Quanta_plus_utf-8

Both editors will pick up each other’s edits, so it’s a cinch to use them simultaneously to edit the same files.

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]

“Could not connect to the server” with Rails 2.2 and Netbeans

Netbeans, Ruby on Rails No Comments »

If you get the “Could not connect to the server” error running you project from Netbeans while script/server works fine, first make sure you have the correct Rails version set for your project, it should show “Installed version: 2.2.2”:

Rubygems_update2

If you still get:

Rails requires RubyGems >= 1.3.1 (you have 1.2.0). Please `gem update –system` and try again.

But the suggested

gem update —system

often fails to update your gem to the new version so try

sudo gem install rubygems-update

and then run:

sudo gem install rubygems-update

and check with

gem -v

where it should show 1.3.1 at the time of writing.

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]
WP Theme & Icons by N.Design Studio
Entries RSS Comments RSS Log in