Home > AS/400 Tips > WebSphere Strategies for iSeries professionals > Set Java version in WDSC for Java development
iSeries 400 Tips:
EMAIL THIS
 TIPS & NEWSLETTERS TOPICS 

WEBSPHERE STRATEGIES FOR ISERIES PROFESSIONALS

Set Java version in WDSC for Java development


Jim Mason
02.17.2005
Rating: -4.50- (out of 5)


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   



[TABLE]

Different versions of Java (JDK 1.3, JDK 1.4 and JDK 1.5) have very different capabilities. They also have very different effects on how you run your Java applications. With IBM's WebSphere Development Studio Client (WDSC) toolset you have the ability to selectively set a Java version for your development environment. That allows you to develop applications compatible with different Java runtime environments.

In this article we'll look at the options and issues with setting different Java versions in the current version of IBM's WDSC toolset: 5.1.2.

[TABLE]
[IMAGE]

Are Java versions really different from each other?
If you're new to Java, you might wonder how different the Java versions are. Coming from an iSeries background, how different is V5R2 RPG from VRr3 RPG? Not very. Older languages such as RPG, COBOL and Visual Basic evolve relatively slowly. Java, on the other hand, evolves faster than any other language today. Changing Java versions may be similar to changing from OS/400 V4R1 to OS/400 V5R1 in the potential impact on development and runtime environments. You don't make those changes without careful planning, training and testing.

In fact, to better reflect the significance of these changes, Sun's adopting a new naming convention. Instead of going from JDK 1.4 to JDK 1.5, they are now also referring to JDK 1.5 as JDK 5.0.

Comparing JDK 1.3 to JDK 1.4
As a developer, I focus on the Java Development Kit (JDK) that is a combination of the Java Runtime Environment (JRE) and the Java Development tools (compilers and utilities). The JRE in a JDK is based on Java 2 Standard Edition (J2SE). Below is a URL from Sun that summarizes the changes from JDK 1.3 to JDK 1.4:

http://java.sun.com/j2se/1.4.2/docs/relnotes/feat


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   


RELATED CONTENT
WebSphere Strategies for iSeries professionals
Application modernization strategies for System i
Application modernization in the i world
Natively supported Web applications for Power running i
Enterprise open source basics
Basic security considerations for a Domino/WebSphere system
Simplifying data access using Java Standard Tag Library
Integrating Microsoft ActiveX components with WebSphere
Choices for running Web workloads on iSeries
Virtual hosting for iSeries Web applications
Automate WebSphere configuration backups on the iSeries (i5)

Web Development
IBM i shop boosts online sales with RPG-based Web platform
Migrating from RPG to EGL on IBM i
Groovy programming on IBM i
Running PHP open source applications: NOBODY needs authority
Zend Web software teams up with IBM System i
The best technologies and tools for System i programmers in 2009
Seven IBM i project lessons learned in 2008
AS/400 lessons from the past, present, and future: A holiday tale
Application modernization strategies for System i
RPG application modernization for i5

Web Tools
Programming for the Web on the IBM i, what is possible
Zend Web software teams up with IBM System i
Using geocoding on AS/400 to enhance your Web presence
The iSeries Blog has a new home on IT Knowledge Exchange
The best technologies and tools for System i programmers in 2009
Search400.com Products of the Year 2008
Application modernization strategies for System i
Natively supported Web applications for Power running i
System i PHP authoring tool tries to fill void in Web-coding know-how
Lazy coder: What does PHP on the i5 mean?

RELATED GLOSSARY TERMS
Terms from Whatis.com − the technology online dictionary
WebSphere Development Studio Client (WDSC)  (Search400.com)

RELATED RESOURCES
2020software.com, trial software downloads for accounting software, ERP software, CRM software and business software systems
Search Bitpipe.com for the latest white papers and business webcasts
Whatis.com, the online computer dictionary


ures.html

Looking at that page, the list of major areas of change in moving from JDK 1.3 to JDK 1.4 covers the following:
XML Processing, New I/O APIs, Security, Java 2D technology, Image I/O Framework , Java Print Service, AWT, Swing, Drag and Drop, Logging API, Java Web Start Product, Long-term Persistence of JavaBeans Components, JDBC 3.0 API, Assertion Facility, Preferences API, Chained Exception Facility, Endorsed Standards Override Mechanism, Java Virtual Machines, Performance, Networking Support, Including IPv6, RMI, Serialization, Java Naming and Directory Interface (JNDI), CORBA, Java IDL, and RMI-IIOP, Java Platform Debugger Architecture, Internationalization, Java Plug-in Product, Collections Framework, Accessibility, Regular Expressions, Math, Reflection, Java Native Interface, Tools and Utilities.

The list of what HASN'T changed would be shorter. This list DOESN'T include all the Java 2 Enterprise Edition (J2EE) changes for Web application servers such as JBoss, WebSphere Express and Apache Tomcat. Those versions also change significantly between releases. For instance, Java Server Pages (JSP) changed radically from J2EE 1.3 to J2EE 1.4 with the addition of Expression Language changing how Web developers build Web pages.

I've also occasionally found small differences between Sun JREs and IBM JREs for the same Java version. That can create additional problems for a developer.

What about the new JDK 1.5 (or as Sun says, JDK 5.0)? While it's available from Sun now, WDSC and Eclipse are not designed to work with it. I haven't tried loading it in WDSC, but I wouldn't expect it to work. There are again many changes from JDK 1.4, even some in the virtual machine that may create incompatibilities with WDSC.

Can you mix Java versions?
You cannot mix Java versions easily. You have a single JRE that is in effect when you compile or run your applications at any point in time. IF you have the wrong version of other frameworks (for instance a XERCES.jar for XML parsing) that is higher in your project classpath (Java's equivalent of a library list), you can hit a variety of runtime errors. By comparison, on OS/400 IBM's install system prevents you from mixing different versions of OS/400 and other system programs (SDA, RPG, etc).

Types of problems I've hit when accidentally mixing the wrong version of a framework with a JRE on a project include the following:

How do you change a Java version in WDSC?
The current version of WDSC (5.1.2) ships with the default JRE as 1.3. You can also use one of the available installed JREs for Version 1.4.

The Java version (JRE level) is set in two places in WDSC: the workspace level and the project level. By default, all projects use the workspace settings for the JRE for compiling and running applications, including the Java scrapbook pages.

To view the current JRE level, on the main menu, do the following:

[TABLE]

To set a different JRE level for your workspace, do the following:

What's the impact of changing a JRE level in WDSC?

You'll need to test your Java applications to see the impact of the update.

In my case, I wanted to use a new feature of JDK 1.4, Java Regular Expressions for parsing Strings. It's part of a new package, java.util.regex. While there are plenty of good third-party Regular Expressions packages that run in JDK 1.3 (see Jakarta Commons REGEX project), I wanted to try out the standard one included with 1.4. In hindsight, it was more work than it was worth in WDSC, since most of my other projects are written to JRE 1.3 and have compile errors in 1.4. Next time I'll use an Apache regular expression jar file, which is easy to add to a JRE 1.3 project (about one minute's work).

Having moved my workspace to 1.4, I tested the Java Regular Expression functions both in the Java scrapbook and some Java classes. The regular expression functions really cut the work down to parse character streams.

One feature of WDSC that doesn't work is the ability to set a compliance level for a project DIFFERENT than the compliance level for the WDSC workspace. Having set my workspace to JRE 1.4, I set my project properties for Java compiler > compliance level to JRE 1.3. After rebuilding my project and retesting my Java classes and scrapbook with the Regular Expression features, they should have generated errors. They didn't. If IBM has a fix for this, I'm not aware of it.

Recommendations on managing Java versions in WDSC
As a Java developer in WDSC, you'll need to be aware of the JRE level (and corresponding Java features) you want to use in your projects and your runtime environments. If you're new to Java, I recommend you stick with the default JRE settings if possible or get some experienced help to think through the specific issues you'll face switching to a different JRE level.

In the future, I'd like to see a version of WDSC that does support project overrides for JRE levels and allows you to pull in more recent versions of the JDK than those shipped with WDSC.

---------------------------------------

About the author: Jim Mason works at ebt-now, an iSeries Web integration company, providing QuickWebServices for iSeries customers: Web planning, WebSphere, WebFacing, Web development, Web networking, Web support, Web security and training services. Jim is creating a self-study course for RPG programmers that teaches "hands-on" rapid visual development with WDSC for all types of iSeries and e-business applications without the need to become a Java expert. The course will be published by Rochester Initiative. You can reach Jim at jemason@ebt-now.com.


Rate this Tip
To rate tips, you must be a member of Search400.com.
Register now to start rating these tips. Log in if you are already a member.


Submit a Tip




DISCLAIMER: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.



iSeries Security - Security Tools, Physical Security and System Security
HomeNewsTopicsITKnowledge ExchangeTipsBlogsAsk the ExpertsMultimediaWhite PapersProducts
About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
SEARCH 
TechTarget provides technology professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective purchase decisions and managing their organizations' technology projects - with its network of technology-specific websites, events and online magazines.

TechTarget Corporate Web Site  |  Media Kits  |  Site Map




All Rights Reserved, Copyright 1999 - 2009, TechTarget | Read our Privacy Policy
  TechTarget - The IT Media ROI Experts