Sayed's thoughts
Wednesday, December 28, 2005
 
New blog site
Hi,
My new blog site is at my new website: www.sedodream.com. You'll find me talking about C#, MSBuild, Java and development in general over there.

Sayed Ibrahim Hashimi

 
Monday, August 29, 2005
 
Upgrading eclipse
Ok,
So recently I've migrated some of my projects to a new machine, and downloaded the newest version of Eclipse. I've done this before and knew that the .metadata folder was no good so I blew that away before anything. Then open Eclipse point to the workspace and create the new project. So Eclipse sees the .Project & .classpath files and loads the build path and everything. It was simple to recreate the dependencies because I had a JAR_RESOURCES variable that pointed to my jar directory. So all I had to do was define that variable and my build path should be set right? Wrong. Look at this error:

Here is the error in the Problems view:
The project was not built since its build path is incomplete. Cannot find the class file for java.lang.Object. Fix the build path then try building this project

So here is the line in my .classpath file that is doing this:
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/j2re1.4.2_03"/&^gt;

I had to change this line to read:
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>

Then I cleaned the project and it build fine. I figured this out by creating a new project in new workspace and examining its .classpath file. I'm not exactly sure how my original .classpath file got screwed up, but it somehow did. I think that it should have been fixed automagically, or idlest I should have been told how to fix it. What would have happened if I wasn't that familiar with Eclipse? I would have been up the creek without a paddle. I imagine I'd have to delete the projects and all the files associated with them and re-define everything. Idlest the problem is not fixed...no I have to see if my Ant will allow me to build it, something tells me I'll have problems with that too [see previous blog related to that :)]

 
Monday, August 22, 2005
 
Java & Focus
Ok,
So recently I've been working a lot with .NET on some large projects. So I have a much better grasp of what happens on that side of the fence. One thing that I've noticed that it was soo much easier for me to go from a clean machine to coding. And .NET has some commercial controls (Syncfusion or Infragistics) There are some commercial controls for Java such as JIDE Soft, but they are nothing like the ones for .NET.
When you're using .NET there is NO question how to build/maintain your projects. This seems like a silly thing to question how to do, but in Java you don't! Lets consider this, you're trying to determine how company X builds/deploys their latest Java product. How do you think they do that? We'll you will first have to know which IDE they are using. You might think that they are using Eclipse, but there are many other IDE's that are very popular. For instance NetBeans and JBuilder. So there goes question number one. Let's assume they are using Eclipse, cuz that's the one that I'm the most familiar. So the team members have 3 (that I can think of off the top of my head) off-the shelf options, 1 of which is just stupid but practiced none-the-less.
  1. Eclipse compiler
  2. Ant
  3. Maven
So (1) I won't even begin to talk about.
(2) Ant is a great tool and I really enjoy using it.
(3) Maven is also a really cool tool, and does soo much more then perform a build.
I have heard of several large companies that actually have created their own build tool and use that exclusively as well! But we'll stick to the ones available. So (2) & (3) are both great tools to use to build you're next Java project. But that's not the problem, the problem is which one is it? Why do we need two? Why do we need n-number of IDE's? Oh that's right because one doesn't offer what I want, so I'll write a new one. Great idea on a small scale, but horribly for the future of Java.
After reflecting on this behavior for a while, I have really been surprised. What I mean is that Java is a language that promotes the community. Like we have open-source software gaining ground, and we like to share. In the .NET world its just not like that, if you want something you just have to buy it, including support. Java having this community feel is one thing that I really love about it. Java is also very open, in the sense that they are not stuck to 1 compiler, they are not stuck to 1 build tool, etc. In theory this is great, but in practice it just sucks. Freedom is certainly not free! Because what you end up with is what we have. Many people working on many different things, each one trying to keep up with his neighbor's. If you follow the feature set of Eclipse & NetBeans you'll see what I mean. If these guys were working on the same product imagine how awesome it would be! If there was only 1 build tool from the beginning that was integrated into that IDE imagine how cool, and easy to use, that would be! This is what Java is missing. As Java projects get larger and larger, maintaining them is just getting crazy. I would definelty be willing to trade in my options for IDE's and build tools, if I could have 1 that was good and that worked great! And I'd even be willing to pay for it, but it would have to be used by most of the other developers. Why do we as developers have to waste time learning a new IDE or buildtool, or version control when we take a new job? Granted this is not a huge effort, it's still annoying and a pain in the ass. And when you think of all the effort that could have been combined to create one product much better then, it's just painful. Anywayz I'm done ranting for the night, just hope that things get better in this aspect for Java.

 
Tuesday, August 16, 2005
 
Ant & Java versions
So I'm working on a Java 1.4 project, but my compiler in the Eclipse is jdk1.5. So I figure no big deal just switch it in the project preferences and specify it in the ant build.xml file. So I made sure that the project setting was for compilation for 1.4 in Eclipse as well as in the ant compile target. In the Ant target I specfiied both source and target to be 1.4. Here is:

<target depends="prepare" name="compile">
<javac classpathref="compile.classpath" debug="true" depend="false" deprecation="false" destdir="${build.dir}" srcdir="${src.dir}" source="1.4" target="1.4">
</javac>
</target>


So I build the app and try to execute it, but get the following error:

BUILD FAILED
java.lang.UnsupportedClassVersionError: com/sun/tools/javac/Main (Unsupported major.minor version 49.0)

So this tells me that it has somehow compiled using the jdk1.5 instead of compiling to 1.4 source for some reason. Since I had run into the problem previously I wasn't surprised actually. But I once again looked through all the settings, even change the jdk to point to 1.4 instead of 1.5 for both ant and eclipse. Change relevent project and workspace settings, but none of this seemed to make a difference. So I go to the window->preference->ant->runtime in Eclipse. I examine the Global entries, and I see it pointing to jdk1.5 tools.jar file. I didn't think that this should be the problem, because I had specified in the build.xml to compile to 1.4. Anywayz I removed that entry and added the tools.jar for jdk1.4 cleaned everything then executed again and it worked! Not sure why this is an issue but seems to be. I think that when I made the change in Eclipse to specify to use 1.4 for ant it should have been auto updated. Now that I think about it, maybe Eclipse didn't know about the 1.4 compiler. Either way shouldn't have been an issue.

 
Saturday, August 13, 2005
 
Java & Open Source
Over the past few years I have grown as a developer. One thing that I notice when I work on projects is that I(we) use soo many third party, and mostly open source, tools. I haven't done much professional development outside of Java, but I'm guessing that using 3rd party libraries, especially open source ones, is more likely when developing in Java. I have some other thoughts as to why this is, but I'll leave those for another day. Soon I'll be working writing C# code so I'll know if my thoughts are correct or not. Then I'll write up a blog about it :)
Back to the topic at hand, I think that there are a few things that separate the programmers from the developers. One of those is to know what tools are available and how to access them. So if you want to be a developer then you should be familiar with a large set of tools that are available to you. For instance if you're writing a web service client, you should know about the
Apache Axis Project, and if you're having to deal with some XML for an app then you most certainly should know about JAXB and Apache Digester. Now how can we as developers stay on top of all these different third party tools? Well the truth is that we can't, but we have to do our best.
I have decided to start examining available open source tools and to share the results with you! I'm going to make an effort to examine a different project each week. I'd like to start with some tools that I'm already a little familiar with, and those that are significant. After a few entries I'll start moving into less known tools. I'll also make a note of what other projects they are using. That way I can find new project to blog on!

 
Thursday, August 11, 2005
 
Graduation Pics
Graduation Pics are in feel free to click them as you like.

 

 
Wednesday, August 03, 2005
 
Afghan Clone!
Not that I support the whole cloning issue, but the first dog cloned (in S Korea) was an Afghan Hound.. For more info read the article at: http://news.bbc.co.uk/2/hi/science/nature/4742453.stm

 
Wednesday, July 06, 2005
 
Dreamcatcher Changes
Now the goals of the Dreamcatcher have change quite a bit. Previously the goals was to create a P2P forum and then provided an implementation that would overlay a dream specific ideology to the entries. But the actually forum contents would be the same. Now the end goal is to create a P2P Forum API that will allow for people to totally customize their forum, and to deploy it. I think this would be interesting and many people would excited about it.
First we will create a Proof-Of-Concept (POC) for the application to show that it works and to figure out where the weaknesses lie.
I think that their will be three major approaches we will undergo along the lines of where content is stored.
  1. Only local database
  2. Local database backed up by dedicated mySql database somewhere on the internet
  3. Local database backed up by entry replication across other peers
The advantage of (1) is that it is the simplest, the major disadvantage is the an entry is only available if the owner is online. The reason to use (2) is that it should be pretty simple to implement once the forum is up and running, and will provide a means to access entries when the owner is offline. (3) can only be successful once many people are using it. If this happens I think that we could get to the point that we have 95% available entries at any time, based on replicating entries across peers. I guess you could also keep that mySql database to provide the other 5 entries. I guess we'll have to see what happens when we get to that point. Obviously we are no where near having to make these decisions.
I'll have to update the Dreamcatcher website, and the design documents soon. Hopefully I'll be able to do this by Monday.

 
Friday, July 01, 2005
 
Eclipse & Ant
Lately for some reason I've found myself having to work from many different machines on the same set of projects. I've always hated working on a project from a machine that I hadn't developed on yet. Never could explain it but always seemed to be a pain. Today I'm working on my Dad's new notebook that he received recently. So here's what I did, from my other machine I copied the workspace onto a CD. When I got here I had to download Eclipse & Java and many other things, so I did all that. Then after I ensured that all the Eclipse classpath's were relative, and resolved any Eclipse build issues...I think I'm home free. But this was not the case. When I tried to invoke Ant to compile the project I got this error:

Need less to say this is not a very meaningful error message, lol. Oh well. So I dug a little deeper, check out the ant properties image below.

Since I knew that I had downloaded a newer version of Eclipse, I decied to confirm that this "C:\Program Files\eclipse\plugins\org.apache.ant_1.6.2" folder actually existed. But indeed it does not, it has been replaced with ""C:\Program Files\eclipse\plugins\org.apache.ant_1.6.5"". So now the question is how to change that? So I looked through the settings, both workspace and project and I was unable to find the entry for this, and I certainly didn't want to change that setting on all those jars listed in that image above, cuz that would just take too long. I'm sure there is a way to change this within Eclipse itself, but I couldn't find out what it was. So I went to the workspace directory and in the .metadata there is a file org.eclipse.core.runtime/.settings/org.eclipse.ant.core.prefs. This file contains all those entries that are displayed on that image from above. So I just did a find and replace, restarted Eclipse and it now works fine. In retrospect, if I'm working on a small project with out many Eclipse settings I might just get rid of that .metadata directory all together, because who knows what else is hiding in there. But it would suck to redefine many build entries for large projects. I wonder if there is a tool that will make all these changes for you, beacuse if you simply upgrade Eclipse on your own machine, you can run into many of these issues. Maybe I'm just in the dark on this one.

 
 
Tutorials coming soon!
Ok, so my dad recently bought a computer. It's not really his first computer, but it kinda is. He 'kinda' had one a while ago, but I think it was really for us :) So now my dad is wanting to learn about these computers and what not. I have agreed to create him some tutorial documents. I have decided that I'll post them here as well, or links to them at least. Here are some topics that I'm going to cover. And these are vey basic things.
This list is not complete or in any order, actually I'm not even sure if I'll do all of these but we'll see. I'll try to create at least one tomorrow. Most likely the email one, because I think that will be the best one for him right now. First I'll get him hooked on email, then next thing you know it...I'll be teaching him Java :)

 

Powered by Blogger