Saturday, July 26, 2008

Installing a Java app is so easy

I'm currently trying to install a java program and it's a nightmare.

The steps you need to make to just be able to install it, is unbelievable.
I'm running Oracle Linux and the program I'm trying to install needs jdk 1.5, which I don't have. No worries, go to the Sun site and you can download it there. I first tried to download the jdk with Sun's download manager. It never worked on my Mac! It took me 15 minutes to figure out there's also a direct link to get the download.

I didn't even touch the application, I'm just preparing my system to get another java app running. To get my system ready (investigating and installing) it took me about an hour.

Next to do: install a webserver. You can go for JBoss, Tomcat or others, but these two are in the documentation and well explained, so I went for Tomcat. I just hope it all doesn't interfere with my current system. I'm not sure you noticed, but I'm still not starting the install of the real app I want to test.

Finally I can install the java app itself. Of course all decends apps also need a database, so most of the java apps I know recommend to use MySQL, but as I'm against that and only want to use Oracle, I'm going for that. It's supported so it should work.

I tried to run the app and got a nice java error. I probably need to do some more investigation, but I don't find it strait forward to have a java app running in a short time.

With the upgrade of the app, I'll probably need another version of java and the nightmare starts again.

The world of Java is so nice. You just take one file and install it in your environment and there you go, right?!

15 comments:

  1. Geez Dimitri, anybody would think you're trying to give Java a bad name by association?!

    You couldn't figure out how to use Sun's website, so by implication that's Java's fault?

    The app at hand wanted to use MySQL, but you like Oracle so that's Java's fault? Or apparently Java supports multiple different databases, yet we have no idea what the Java programmers did with their SQL, so it may fall over, yet that's Java's fault? I've been waiting for Apex to be released on different database platforms, but apparently the programmers hardcoded it to Oracle? What gives?

    The app didn't run, because it was probably misconfigured, but that's Java's fault? I ran an Apex app once that spat back a thousand errors. Apparently I'd forgotten to install the database schema. Go figure?

    When you upgrade the app you don't want to upgrade Java, yet how is that the fault of Java? The programmers who wrote the program decided to go with latest Java libraries. To use an analogy, surely if I wrote a Apex program in Oracle 10g, then wanted to use some 11g specific features, that would force you to upgrade your database too? How are the choices of the programmers the fault of the language? Are you suggesting Java should magically include all future features now so you never have to upgrade Java? Boy, I hope Oracle comes out with a database just like that soon.

    At the bottom of your post you're talking about a simple Java program, but in the middle you're talking about using a full blown 3tier solution with an app server? Which is it? It's really hard to hit a moving target.

    Mate, I'm not sure I can keep up. I've a great suggestion for you. You should try out JDeveloper 10g/11g, I've found programming Java with these Java IDEs to be far less of a headache then you seem to get ;)

    CM.

    ReplyDelete
  2. Hi Chris,

    I didn't want to say anything bad about the java programming language. I just got frustrated that to get something to work (in this case a java app), I had to do all these steps.

    The same counts for any other apps I had to install in my windows time. You had to have different dll, vb or .net libraries and when installing one program the other didn't work anymore as the dll had another version etc.

    If I look at for ex. Mac, how it works there. Just a dmg file, you run it and that's it. It just works.

    As for APEX, if you do it "right", you have just one file you need to install. The supporting objects can handle all the database stuff. It's a much simpler architecture, that's sure. My last sentence "You just take one file and install it in your environment and there you go, right?!" was trying to hint that.

    About JDeveloper, I absolutely agree it's a great tool to use. But again, I just wanted to try a program, I didn't care in which language it was written. But it all started with getting a jdk version. I don't want to blame anybody, except the company who wrote the soft and the installation guide. Although I'm not sure you can really make the installation simpler?

    About APEX being released on different db platforms, that is never been an option. As for hardcoded it to Oracle, APEX is an option of the database, written in PLSQL, so yes it's 100% Oracle.

    And to give me no headache, I want one file, that installs everything it needs and it just works.

    Dimitri

    ReplyDelete
  3. I also wanted to share, there are java apps that have a one zip file, that just work.

    For ex SQL Developer. Unzip, ready to go... that's what I want!

    ReplyDelete
  4. Are you an idiot?

    You cant install a java app, so its Javas fault and not yours?

    Grow up. Be a Man. Quit whining and learn how to do the simple things in life.

    ReplyDelete
  5. I agree with Chris

    That baby picture is you, crying like baby cuz you need your hand held to install a simple application

    I bet you ring the helpdesk when your PC screen is blank without checking you turned it on first.

    See what happens when you use a toy tool like Apex? You cant use a real tool like Java cuz you are out of your depth.

    Dumb cry-baby.

    ReplyDelete
  6. Hello "Anonymous",

    Apparently I hit a soft point.

    I don't want to blame "Java" in general. As I mentioned before there are apps that work easily, but in the case of the app I did the post on, to me it was frustrating.

    I want to use the app, I don't care if it needs a specific version of the jdk or whatever. Why can't it just include everything it needs?

    And sure, it's my fault I had problems installing it, nobody else, because I did the install.

    Nevertheless I believe that if you make an app in any technology, it should be as smooth as possible to get it to work. If it frustrated me, I guess I wasn't the only one. I strongly believe people won't use a product if it's too hard just to get the first screen, they just try another one.

    I don't want to whine, I want to help people in the software industry...

    But I appreciate any feedback and maybe I was too hard. I respect your opinion.

    Dimitri

    ReplyDelete
  7. Would you expect a .exe to include a full installation of Windows too?

    Geez, so every time you install a Java app you want it to include a full copy of the JDK?

    Any idea how stupid that sounds?

    Do you even know what Java is?

    Stupid!

    ReplyDelete
  8. Hi Dimitri

    It's the sarcasm in your subject line that's making people jump down your throat, and the fact that "by association" you rubbished Java and the JEE application server technology, rather than talking about the faults of the application at hand. You don't even bother to mention that application by name, maybe you should have complained about that instead.

    The facts:

    Java apps, like Apex apps, *can* be run form a single file. Java has archives like .jar, .war and .ear files for just this purpose. It is a great strength of Java that it has these and other modern languages have used similar techniques. It has gone a long way to tidying up the mess of deployed apps on servers by the fact that it's standardized everything, in the same way the import/export files of Apex/Oracle have helped make that an easy install.

    Any comparison I used to Apex was to show that Apex isn't that simple either, they're in fact comparable.

    For Java you need a JVM, for Apex you need an Oracle database. Neither install is difficult, but each however requires more than 1 step. Just because you have a preference for Oracle databases doesn't mean that the other environments are less than best.

    For Java programs you (may) need the specific JVM version you wrote your program against, same deal with Apex, the PL/SQL it uses and the database. If you write an Apex application under 11g using 11g new features, but try and back port it to 10g, you know the outcome.

    So mate, you hit a nerve in the fact you're not being fair, and you've mispelled the facts.

    I apologize for the tone of the other "anonymous" posters here, I didn't intend to kick a hornets nest, I think they're being rude, as well as cowardly for not posting under their real names. However I see you're being "pursued" by others on your blog, so as suggested by some more helpful posters, time to turn on Blogger comment moderation I think.

    I look forward to catching up at OOW for a chinwag.

    Cheers,

    CM.

    ReplyDelete
  9. Hi Chris,

    I appreciate your feedback. You've certainly a point.

    And yes I didn't say the name of the product as that wasn't really my point when I posted the article. It wasn't the first time I had issues with the different versions of the jdk. If you know you need to play around with the CLASSPATH and/or JAVA_HOME, you can get around most issues.

    I surely don't know enough about JAVA to understand all moving parts. The only experience I have is with Oracle, and to be frankly, if you use Oracle AS and JDeveloper it's not that difficult to deploy your app. Right click, deploy, done.

    With most of what you write I agree, however that APEX would be comparable with JAVA, I don't agree. I strongly believe that JAVA is/can be way more complex.

    Yes, look forward to meet you at OOW too. I guess it's my turn to get some feedback of Java lovers, after you had your share of the APEX community after one of your posts ;-)

    But it's great that we can all discuss about it. It surely helped me to rethink about some things you mentioned.

    Dimitri

    ReplyDelete
  10. Hi guys,

    I come from a mixed programming background, having done Java and Oracle PL/SQL and more recently APEX.
    Like any programmer in any language, configuration is the least liked job. Logically and sadly, this must be one of the most important jobs of a programmer as well.
    Opinions about how well, or how bad an environment is to configure depends on 2 things; Experience and Experience !

    Even a javanic scholar will scratch behind his ears a few times with a Java configuration, when he has never done it before. Just as someone that never configured an Oracle environment will have his share of questions/problems to solve.

    Because I've done both, I think I can make a fair judgment for myself on which is simpler. And I must say that it is APEX that has a simpler flight plan and pre flight checklist before actually flying the plane.

    I think this can be contributed to the unified way APEX is served. As for Java, many variations of different possible configurations seem to cloud your goal of simply getting an application to work. This is overcome when you did it a few times, but still it is a challenge for anyone who hasn't.

    And before the comments from the java world come to us saying that it makes java much more flexible etc. That's not what I'm trying to argue here. APEX is configured more easily because it is focused on one variation doing what it is supposed to. As for java you need to find the right mix of ingredients before doing that and making the end result tasteful.

    So I can understand Dimitri's frustration getting something to work, as we've probably all been there in the past, even you anonymous guys!

    Just my 2 cents...

    greetings Rutger

    ReplyDelete
  11. Hi Dimitri,
    Are you running OEL5? If yes, then you can install Java apps with JPackage.

    A quick and dirty guide can be found in http://lists.centos.org/pipermail/centos-docs/2007-August/000516.html

    Type

    rpm -qa | fgrep jpackage

    If you have JPackage, good; if you don't have it, you can use the CentOS (RHEL clone, like OEL) RPM from http://centos.pop.com.br/5.2/os/i386/CentOS/jpackage-utils-1.7.3-1jpp.2.el5.noarch.rpm

    After you're done installing JPackage, time to build the JDK RPM. No, the one you download from Sun isn't ready to use "out of the box" for server apps.

    Login as oracle (or some other user - but not as root) and create file ~/.rpmmacros with the following content:

    %_topdir /home/<username&gt./rpmbuild
    %_tmppath %{_topdir}/tmp

    Create the directory tree:

    mkdir -p ~/rpmbuild/{SOURCES,SRPMS,SPECS,RPMS,tmp,BUILD}

    Quite a bit of work... We're half done.
    Get the JDK 5.0 Update 15 at http://java.sun.com/products/archive/j2se/5.0_15/index.html - I suppose you're running Linux, so you should be directed to a page that offers an RPM and a non-RPM file. Download the non-RPM (Linux self-extracting file - jdk-1_5_0_15-linux-i586.bin) and move it into ~/rpmbuild/SOURCES

    Now download the java-1.5.0-sun-1.5.0.15-1jpp.nosrc.rpm file containing the build instructions from http://www.jpackage.org/browser/rpm.php?jppversion=1.7&id=8083 and type

    rpmbuild --rebuild java-1.5.0-sun-1.5.0.15-1jpp.nosrc.rpm

    Wait a few minutes and you should have several shiny new RPMs in ~/rpmbuild/RPMS/i586

    Install them as root.

    su -
    cd /home/<username&gt./rpmbuild/RPMS/i586
    rpm -Uvh java-1.5.0-sun-1.5.0.15-1jpp.i586.rpm
    rpm -Uvh java-1.5.0-sun-alsa-1.5.0.15-1jpp.i586.rpm
    rpm -Uvh java-1.5.0-sun-plugin-1.5.0.15-1jpp.i586.rpm

    Java should be installed.

    # java -version
    java version "1.5.0_15"
    Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_15)
    Java HotSpot(TM) Client VM (build 1.5.0_15, mixed mode, sharing)

    Configure the JPackage repositories in yum as per step 2 in http://lists.centos.org/pipermail/centos-docs/2007-August/000516.html

    Now you should be able to just

    yum install tomcat5 tomcat5-admin-webapps

    and be done. Of course, these are good for CentOS/RHEL; On OEL, YMMV.

    Georger

    ReplyDelete
  12. Geez Dimitri...never seen someone do a U-turn so quick

    First you hate Java then when people argue back you back down

    You need some balls!

    ReplyDelete
  13. >> Anonymous

    Well at least Dimitri can put his name on an opinion, give him much more leeway to change his mind.

    ReplyDelete
  14. At some point I agree with Dimitri. I hate if I need to do many manual work just to install an application, copy here, copy there, edit here edit there.
    We have developed an Java application and we always included the JDK on the installation package. Customer happy! I know you Java geeks love a challenge...the bigger the better...that is why you choose JAVA ;)

    ReplyDelete