Tag Archives: java

[SOLVED] Netbeans svn error “Duplicate extensions not allowed, OPTIONS request failed on ‘path'”

I have installed sun-java-jre/jdk on my Ubuntu and Fedora. I am using svn for my project and have been running it well with my old Fedora 15 installation on my old PC. However, recently I installed Fedora on my other machine and installed Netbeans 7.0.1 on top of sun-java. Fedora did not handle graphics very well, so I installed Ubuntu alongside as well. But every time I tried to access subversion functionality from Netbeans, I got the following error:

org.tigris.subversion.javahl.ClientException: java.io.IOException: Duplicate extensions not allowed
OPTIONS request failed on ‘/relative/path/to/some/project/directory’

This happened in both of my newer installations, Fedora 15 and Ubuntu 11.04, both with Netbeans 7.0.1. I tried several things but all in vain. Finally, when searching for installed Java related packages in my old machine (where subversion always worked), I found the required package. The cryptic error message will simply stop appearing and Netbeans subversion will start working after the installation of svn client adapter for Netbeans. Here is how you can do it from the terminal:

For Fedora:

su -c 'yum install netbeans-svnclientadapter'

For Ubuntu:

sudo apt-get install libnb-svnclientadapter-java

Hope this helps.

[HOWTO] Install Sun/Oracle Java JDK 7 in Fedora 15

Sun/Oracle Java JDK 7 may be required to run some applications that are not compatible with OpenJDK which can be installed using package manager in Fedora 15. Here is how to do it. Open the terminal and use the following commands:

For 64-bit

wget "http://download.oracle.com/otn-pub/java/jdk/7/jdk-7-linux-x64.rpm"
su -c 'rpm -i jdk-7-linux-x64.rpm'

For 32-bit

wget "http://download.oracle.com/otn-pub/java/jdk/7/jdk-7-linux-i586.rpm"
su -c 'rpm -i jdk-7-linux-i586.rpm'

If you already have OpenJDK/OpenJRE installed, you will need to configure your system so that the applications use the Sun/Oracle Java version instead of OpenJDK/OpenJRE. Here is how to do it:

su -c 'alternatives --install /usr/bin/java java /usr/java/jdk1.7.0/jre/bin/java 20000'
su -c 'alternatives --install /usr/bin/javaws javaws /usr/java/jdk1.7.0/jre/bin/javaws 20000'
su -c 'alternatives --install /usr/bin/javac javac /usr/java/jdk1.7.0/bin/javac 20000'
su -c 'alternatives --install /usr/bin/jar jar /usr/java/jdk1.7.0/bin/jar 20000'

For 64-bit:

su -c 'alternatives --install /usr/lib64/mozilla/plugins/libjavaplugin.so libjavaplugin.so.x86_64 /usr/java/jdk1.7.0/jre/lib/amd64/libnpjp2.so 20000'

For 32-bit:

su -c 'alternatives --install /usr/lib/mozilla/plugins/libjavaplugin.so libjavaplugin.so /usr/java/jdk1.7.0/jre/lib/i386/libnpjp2.so 20000'

Hope this helps.

[HOWTO] Install Selenium Module for PHP in Netbeans 7.0 beta

If you are using Netbeans 7.0 beta, the plugin list may not show Selenium Module for PHP. To install it, navigate to Tools>Plugins>Settings and click on Add. Then, in the name field, enter something like “Netbeans 6.9 beta” and in the URL field, enter the following URL:

http://updates.netbeans.org/netbeans/updates/6.9/uc/final/beta/catalog.xml.gz

Now, reload the cataloge and you should be able to install Selenium Module for PHP.

Happy developing.

[HOWTO] Update vuze (azureus) to latest version 4.5 in Ubuntu 10.10 Maverick Meerkat

I installed Vuze bit-torrent client and it seems really awesome. It has been written in Java but it is pretty fast and awesome. It has search and many helpful plugins. It has various types of options and configurations and it will sure take me some time to figure out. I installed it from Synaptic Package Manager and got the version 4.3.0.6 (Ubuntu Software Center will do the same). I went to the website and saw that 4.5.0.4 was available already. I downloaded the linux installer (Vuze_Installer.tar.bz2) and unpacked it. I got a directory named “vuze” which contained the files. Then, I just launched terminal and changed the directory to “vuze”, the one that I just extracted.
Then, I just had to copy the files to where they belong. Remember, you must have the version from the package manager installed. Then, I just backed up the original vuze files and then copied the new files over.

sudo mv /usr/share/java/Azureus2.jar /usr/share/java/Azureus2.jar.bak
sudo cp Azureus2.jar /usr/share/java/Azureus2.jar
sudo mv /usr/share/java/swt.jar /usr/share/java/swt.jar.bak
sudo cp swt.jar /usr/share/java/swt.new.jar
sudo ln -s /usr/share/java/swt.new.jar /usr/share/java/swt.jar

Now, restart vuze to check if everything works well. If it does, great, congratulations. Check the version and check if it was successfully updated.

However, if it does not run well or does not run at all, you can always get back the original installation. One way to do that is “Mark for Reinstallation” from Synaptic Package Manager (or remove and install again from Ubuntu Software Center), the other way is to undo whatever you have done via the command, which is pretty easy to figure out.

Hope this helps.

[HOWTO] Make Ubuntu 10.04 Lucid Lynx Mono Free

Ubuntu 10.04 comes with 3 default applications that depend on mono. They are
F-Spot, a photo manager
Tomboy, a note taking application
Gbrainy, brain teaser game and trainer
To get rid of mono and still keep the functionality, we need non-mono alternatives to these applications. Lets look at those. But first, let me write something about why someone may want to remove Mono.

Why remove Mono?
There are several reasons why someone may want to remove Mono from their Ubuntu installation. You may want to gain some free space. Mono takes up a lot of space for just a few applications. If you remove and replace them with others. This may not seem important if you want to run Ubuntu off normal harddisks these days, but it may be crucial if you want to remaster Ubuntu with few added applications and still want to distribute it on a CD or limited sized USB drive.
You may want to remove Mono for other reasons like it is an implementation of standard set by Microsoft or just because it is a short name for a contagious disease.

Why not remove Mono?
You may not want to remove Mono if you just want to free some space from your installation because it may not be the case when you start installing other applications based on Mono. You see, the alternatives also have dependencies and the different dependencies for all the alternatives may occupy more space than Mono.
Also, Mono seems to be a popular platform and there are many great applications like Docky, Banshee, Beagle etc. which need it. Moreover, many new applications may come up which need Mono and you may have to install it anyway.

Enough of that. Now, lets get to the applications.
F-Spot
F-Spot is to be removed from default install from Ubuntu 10.10 Maverick Meerkat and is being replaced by Shotwell. So, you can install Shotwell as a replacement to F-Spot. There is yet another photo manager called Gthumb but I think Shotwell is the better choice.

Tomboy
Tomboy is a really great note taking application. However, an almost exact clone which can import and use all the notes created by tomboy is available. It is called Gnote. Tomboy can be safely replaced with Gnote. Gnote is a C++ port of Tomboy and claims to be faster. Also, if you use the gnote stable ppa by adding ppa:gnote/ppa to your software sources, you can install gnote 0.7.x which features a nice gnome-panel applet for Gnote.

Gbrainy
I don’t know a good replacement for this great game, but it is just a mind teaser game. So, if you can do without it, just remove it.

Following is the step by step procedure for doing this.

Repositories
Open up Synaptic (System>Administration>Synaptic Package Manager) and click on Settings>Repositories. Make sure “Community maintained open source software (universe)” is selected. Now click Other Software tab and click Add. Then copy/paste the following

ppa:gnote/ppa

and click Add Source. This will add gnote PPA so that you can install the latest version of Gnote. Close the repositories window. Click on Reload so that the software lists are fetched from all repositories.

Removal of Mono and Installation of Alternatives
Search for shotwell and gnote in Synaptic Package Manager and mark them for installation. Search for mono-runtime and mark it for removal. This will ask for your confirmation that several other mono related packages including F-Spot, Tomboy and Gbrainy will be marked for removal. Just confirm it and click on Apply. This should free about 40 MB of Disk Space and download about 3 MB only.
To add Gnote panel applet, press Alt+F2 and type in killall gnome-panel and then when the panel loads back, Right click on it and select Add oo Panel, search for Gnote and click Add.

Other Softwares that depend on mono and alternatives
There are few other great softwares based on mono that are great but aren’t included in the default install. However, lets discuss them too. If you have any of those installed, they will be removed too. So, lets get to their alternatives.

Docky
Many Ubuntu users use Mac OS like docks these days. One such great dock is Docky. But there are some other good docks which can serve as a replacement for Docky. One of them is Avant-Window-Navigator. It is not so friendly in terms of disk space though. It consumes over 40MB of disk space and hence defeats the purpose if you are trying to remove mono because of disk space usage. Cairo dock may serve as a good replacement in that case.

Banshee
Banshee is a popular music player and media management application and favorite gnome media manager for lot of Linux users. However, the default Music Manager Rhythmbox should serve as a good replacement for it for a lot of users. Exaile is also good one.

Gnome-do
I never really got used to this application. I primarily used it for Docky (Docky was originally a part of Gnome-do) and never used other features that it had to offer. However, there are some huge fans of this application. It claims to get things done faster in Gnome. There is another application called kupfer (it is not a KDE application as the name suggests, yes I’m talking about its initial letter :D) which claims to to provide similar functionality. It also has a lot of plugins and you should really give it a try. But it does not look sleek as Gnome-do though.

Beagle
Beagle is a indexing and searching tool for the Desktop. Tracker, Pinot or Google-Desktop-Search should serve as replacements.

Bless Hex Editor
Bless is a GUI hex editor which is really awesome. There is a replacement called ghex for it but it is not as good though.

Muine Music Player
Muine is a simple music player. It aims to be and remain simple music player. I haven’t really used it but I think the default movie player Totem, which can be used as audio player too of course, can provide everything that Muine has to offer.

Graphmonkey
This one is a graph drawing application written in GTK#. I found a replacement called extcalc (qt3 application) but it is not as simple (which in other words also means it is more powerful and includes more features such as scripting :)).

Tangerine
Tangerine is a DAAP server which can serve music to Apple iTunes, Rhythmbox, Banshee, Amarok, XBMC, Limewire or any other music player that supports this protocol. I haven’t actually used it but there is another package mt-daapd which claims to provide similar functionality.

Smuxi
It is an IRC client. There are several IRC clients that should replace it. I use X-Chat.

Mistelix
Mistelix is a DVD authoring application. I don’t actually do any of that, but according to this article, one or a combination of Q DVD-Author, DVDStyler, DeVeDe, ManDVD, and tovidgui should be able to provide what Mistelix does.

gtwitter
This is a twitter client. The default application Gwibber should be a good replacement for this.

gnome-rdp
gnome-rdp is a remote desktop client for Gnome. It can be replaced by reminna.

Cowbell
It claims to be a music organizer and tagger. I am assuming EasyTag or Picard should serve as a replacement.

Tasque
Tasque brings Remember The Milk service (TODO list management) to the Desktop. However, Avant Window Navigator, Screenlets or Deskbar can offer similar functionality with RTM-related plugins.

Blam
Blam is an RSS Aggregator. Liferea, Yarssr and many other applications provide this functionality.

DFO
DFO (Desktop Flickr Organizer) is a photo manager which integrates with Flickr. I think only Kflickr (KDE Based) comes as close.

Drapes
Wallpaper rotator for Gnome. Nitrogen and Wally should serve as replacements.

gshare/giver
These are easy file sharing applications. BaShare can serve as a replacement.

last-exit
It is a Desktop Last.fm player. Rhythmbox or lastfm should serve as a replacement.

LAT
LAT is a LDAP Administration tool. Luma or GQ can serve as replacements.

themonospot
It is a simple media information extractor. MediaInfo serves as an excellent replacement.

bareftp
Bareftp is a FTP client. Filezilla Client, gFTP-GTK and various other GUI FTP clients can replace bareftp.

hipo
It is an iPod manager. gtkpod serves as a replacement.

Sysinfo
It is a System Information Tool. It can be replaced with Hardinfo. Ailurus also has this feature.

thelastripper
It is a Last.fm stream dumper. lastfmproxy and streamdumper can be used to do the same.

gnome-subtitles
Gnome subtitles is a sub-title editor. SubtitleEditor can serve as a replacement.

autopano-sift
Panorama images creation helper. Hugin should be a replacement.

youtranslate
It is a translation application which makes the use of online translators such as Google Translate. freespeak should serve as a good replacement.

Mono
Mono is an open source, cross-platform, implementation of C# and the CLR that is binary compatible with Microsoft .NET. If you don’t want to use it but still want to develop C# applications that run on Linux, you can go for dotGNU. But unlike Mono, it is not available from Ubuntu software center or officially supported by Cannonical.

C#
If you want to develop cross platform applications or applications for Linux and don’t want to use Mono, C# is not the language you should go with. A better language may be Java, Python or Vala.

Final Notes
I have tried to list all the applications that may prevent you from removing mono. However, I have not used all the programs that I have listed (at least not used them enough to get used to them or to know what features they offer or even to the extent to know them in any way). So, if you think I have missed a program or an alternative, please let me know via comments.
Thank you for reading.

[SOLVED] java.security.AccessControlException: access denied (java.net.SocketPermission host connect,resolve)

[ad#ad-1]I am building a Java Applet which needs to connect to foreign host to operate. I created it and it runs good on OpenJDK Runtime Environment (IcedTea6 1.8pre) installed on my Ubuntu 10.04 Lucid Lynx Beta. But it does not run with Sun Java Runtime Environment 1.6.0_18 on Windows. I don’t know if it also does not work with Sun JRE in Linux. Also, as far as I know, OpenJDK/OpenJRE for Windows does not exist.

The applet shows somewhat this kind of when run in Windows under Sun JRE:

java.security.AccessControlException: access denied (java.net.SocketPermission host connect,resolve) 

and the page just stalls.

When I searched for help on the internet, I discovered that unsigned files do not run in Windows. So, I needed to sign it. The Certificate can cost at least a couple of hundred dollars for a month. If you are using it for commercial purposes, I advice you to buy a certificate. However, I just wanted my code to run in Windows and to do that I bundled the code inside a Jar file (I was just using the class file i.e. code=”Classname.class”. Now I need to use code=”Classname” archive=”JarName.jar” for applet in the HTML file.). So I am sharing what I did to make it run.

After building the Jar File (Netbeans IDE that I am using builds the Jar file automatically inside the dist sub-directory of the Project directory), I used the command

keytool -genkey

and entered the details. You can choose your own password for keystore. You can either use the same password for key password or choose a different one. Now a keyfile named .keystote is created in the home directory. I need to certify the key. Since I have not purchased a security certificate, I needed to certify it myself using the following command:

keytool -selfcert

. Now a key named mykey is created for me to use. This should only be done once.

Now, I changed my directory to the dist directory and executed the following command to sign a MyJarApplet.jar:

jarsigner -storepass KeySorePassword -keypass KeyPassPassword MyJarApplet.jar mykey

Here KeyStorePassword is the password used while creating the keystore and KeyPassPassword is the password used in the key mykey.

Now, the applet asks for authentication instead of showing nothing at all in Windows too.

Hope this helps.

References:
http://www-personal.umich.edu/~lsiden/tutorials/signed-applet/signed-applet.html
http://java.sun.com/j2se/1.4.2/docs/tooldocs/solaris/jarsigner.html
http://java.sun.com/j2se/1.4.2/docs/tooldocs/solaris/keytool.html