Showing posts with label eclipse. Show all posts
Showing posts with label eclipse. Show all posts

Thursday, November 10, 2011

Upgraded to Subversion 1.7


If I am asked why you don't like SVN, the evil .svn folders is the answer. With the newly introduced Centralized Metadata Storage, there is only one .svn directory for each project, just like the .git folder in Git repository. Is it time to re-love Subversion? Well, yes and no.

In order to support this new feature, you have to install Eclipse Subclipse plugin 1.8.x. But before that, it's better do a
svn cleanup
for all of your working copies. Although I didn't do it and so far so good, don't risk it.

If you followed this tutorial and installed libsvn-java, please uninstall it. Because at the time of writing, the version of libsvn-java in Ubuntu repository is 1.6.12. When you try to access SVN server, you'll get
Incompatible JavaHL library loaded. 1.7.x or later required.
Follow this to install libsvn-java 1.7.0 and upgrade your working copies with
snv upgrade
Now you have a centralized .svn folder. But don't think you can operate directories and files freely from now on. I use Subclipse 1.8.2 on Eclipse 3.7 SR 1 on Ubuntu 11.10 and found if you delete files and folders directly from file system, the deleted files and folders wouldn't show up in Synchronize view. However, if you add new files and folders, or modify files directly in file system, the plugin will get all the changes.

Even if you delete a folder from Eclipse, and copy a folder with same name but with some changed files, you may get
Could not remove /home/jerry/java/workspace/...
It looks like the metadata fails keeping integrity. I suggest you keep all the folder structure and remove all the files in a folder tree in Eclipse, and copy a whole folder tree with files into project later. Although you may still have following errors, after you refresh project, everything should be fine.
Errors occurred while updating the change sets for SVNStatusSubscriber
org.apache.subversion.javahl.ClientException: SQLite error
svn: database table is locked
svn: database table is locked: WORK_QUEUE

Errors have occurred while calculating the synchronization state for SVNStatusSubscriber.
org.apache.subversion.javahl.ClientException: SQLite error
svn: database table is locked
svn: database table is locked: WC_LOCK

org.apache.subversion.javahl.ClientException: SQLite error
svn: database table is locked
svn: database table is locked: NODES
I summarize my suggestions:
  • always delete files from IDE;
  • if files changed but folder structure remain the same, don't delete folders from IDE



Wednesday, September 07, 2011

Java development using Ubuntu 11.10 and OpenJDK 7


I tried Ubuntu 11.10 Oneiric Ocelot Beta 1. LightDM is lighter and beautiful. Maybe I can keep using Ubuntu on my ThinkPad T42, rather than jumping onto Lubuntu.

Due to the retiring of the "Operating System Distributor License for Java (DLJ)", Sun / Oracle JDKs / JREs cannot be installed by enabling Canonical Partners' repository any more. It's a good news to OpenJDK. With more usage of OpenJDK, we can expect higher priority and fewer bugs.

Since Java 7 is out, the first thing I did is installing OpenJDK 7. From Ubuntu Software Centre, you can only install JRE. I miss Synaptic Package Manager.
sudo apt-get install openjdk-7-jdk

Change default JRE of system from OpenJDK 6 to 7.
sudo update-alternatives --config java

I got following error when installing Subclipse plugin to Eclipse.
An internal error occurred during: "Install download0".
Library /usr/lib/i386-linux-gnu/libsoftokn3.so does not exist

Creating a symbolic link sovled it.
cd /usr/lib/i386-linux-gnu/
sudo ln -s nss/libsoftokn3.so libsoftokn3.so

After Subclipse is installed, I had a small problem in starting Eclipse 3.7 Indigo, but it's a common one.

sudo apt-get install libsvn-java
and
-Djava.library.path=/usr/lib/jni
in eclipse.ini solved it.

m2eclipse and Google plugin for Eclipse work out of box. Maven 3.0.3 works fine with OpenJDK 7.

Apache Tomcat 7.0.21 works fine with OpenJDK 1.7.0 but if you haven't created the above symbolic link, you'll get below error when starting Tomcat.
java.security.ProviderException: Library /usr/lib/i386-linux-gnu/libsoftokn3.so does not exist
at sun.security.pkcs11.SunPKCS11.(SunPKCS11.java:292)
at sun.security.pkcs11.SunPKCS11.(SunPKCS11.java:103)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)

I also tried to install Gnome Shell.
sudo apt-get purge gnome-shell

Installation finished successfully but later when I specified Gnome to login, I got a dialog box saying
failed to load session "gnome"

There are a couple of solutions to the problem but none works for me, so I installed classic Gnome.
sudo apt-get install gnome-session-fallback

A fantastic experience, I'm looking forward to its release next month.

Friday, June 17, 2011

Performance of Virtual Machine

I gave up dual boot when I upgraded to Ubuntu 11.04 and moved Windows into virtual machine. The performance of Windows guest was good, 35 seconds from power on to desktop (very good as my HDD is 5400 rpm), until I began using it seriously.

I've done a benchmark of compiling one of my GWT project in Eclipse four times. I still remember Turbo C can compile 10 lines of code per second, while Turbo Pascal can compile 100 lines per second when I was in university. Compilation is quite suitable for benchmark because it involves both CPU and I/O tasks.

1st2nd3rd4th
native in Ubuntu82818079
in VirtualBox143195196265
in Vmware Player112107108108

The Windows I'm using in virtual machines is Windows 7 Professional 32-bit. IDE is Eclipse for Java EE 3.6.2 32-bit for Linux and Windows. Virtual machine software are Oracle VirtualBox 4.0.8 and VMware Player 3.1.4, for Linux of course.

This is by no means a scientific benchmark, but what I got is if you plan to use a Windows guest heavily in a Linux host, VMware Player is the one to go with at the moment.

Saturday, April 30, 2011

Natty Narwhal installed

As always, I installed latest Ubuntu 11.04 at the first time. Unity is not that bad but I did experienced a problem that I had to force power off my laptop. Unity 3D doesn't require decent graphic card. Auto-hide launcher and global menu help to save screen real estate, new scroll bar is cool. But to be on safe side, I stick with classic Gnome at the moment.

One interesting issue occurred when I was installing MyEclipse 9.0 on my new system. Since I have 4GB memory I didn't create Swap partition. That's a reasonable choice but I got following prompt

Insufficient Memory
Your system does not have sufficient memory to support MyEclipse. MyEclipse requires 256 MBs physical memory and 64 MBs virtual memory. Your system only has 3913160 MBs of physical memory, and 0 MBs of virtual memory.

I don't know why Eclipse doesn't require virtual memory while MyEclipse does. And why 3913160 MBs (I didn't say I have 4 TB memory, MyEclipse said that) of physical memory is not sufficient.

Anyway, I'm pretty happy with new Ubuntu release but if part of Ubuntu users switch to Fedora 15, which will be released next month, I won't be surprised.

Thursday, November 11, 2010

A bug in GWT Designer

Two projects in my team encountered the same problem this week. If you have more than one classes (public A and non-public B) in a Java file (A.java, of course) in GWT client side, there will be compilation errors in GWT problems marker category saying
B can not be found in source packages. Check the inheritance chain from your module; it may not be inheriting a required module or a module may not be adding its source path entries properly.
However these errors affect nothing. You can still run as / debug as web application in development mode, or GWT compile the whole project successfully.

I'm using Eclipse Helios 3.6.1 (Service Release 1) in Ubuntu with
  • Google Plugin for Eclipse
  • GWT Designer

After investigation, I found it should be a bug of GWT Designer and reported it to GWT team.

If you really mind the "errors" and need to use GWT Designer, I think you know how to deal with it. In case you want to get rid of GWT Designer, go to Help - About Eclipse - Installation Details - Installed Software, and uninstall all the items with Id starting with com.instantiations.


18/11/2010 Update: It's a bug of Enhanced Compilation and got fixed in GWT Designer BETA.

Wednesday, September 01, 2010

MyEclipse 8.x

It's so painful to install plug-ins in MyEclipse 8.x. It tries to block you from directly access update URLs with a so-called Software Centre. Things become even worse if you're behind a proxy. What's funnier are You can't update Eclipse 3.5 behind the proxy and MyEclipse still refuses to base itself on Eclipse 3.6.

Anyway, I just want to share a tip in plug-in installing in MyEclipse 8.5. See the screenshot. Note the "Connect directly to host" option.

Friday, January 29, 2010

Submitted another bug to Eclipse

It's unavoidable to have ambiguous types in single Java file. The way to solve the problem is very easy, using fully qualified class name. Unfortunately, the Content Assist of Eclipse 3.6M4 is not that smart to generate correct code.

I submitted this bug to Eclipse today and let's see what will happen.