Sayed's thoughts
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.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
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












