Help coderanch get a
new server
by contributing to the fundraiser
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
  • Mikalai Zaikin

use a specific jvm with ant

Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am currently in a situation where I must use a supplied modified jvm /jre version 1.4. If you must know its the JVM/jre that is supplied with IBM's WebSphere Application Server 6.1.

In order for the class files to work when deploying to WAS. I need to build using the same jvm as WAS. I have tried using the standard jvm to complie. (this hasn't worked for me yet, so I currently import the IBM modified JRE into eclipse and use the ant build functionality from within Eclipse (IBMjre) ).

I have several projects with classes in each that are used in the final project. Currently I am required to use the IBMjre in each project and build each project individually and pull the complied class files into the ear that I deploy.

1) I want to be able to build in one location, not 3 separate.
2) I do not want to have to import the IBMjre int eclipse to develop, to be able to develop and clean in eclipse using new version of jre (1.6), and when comes time to build the project ear do so with the IBMjre at that time. Backwards compilation of files developed on new version (in my understanding) is not an issue.

Currently each project has the following build.xml file.

then in the final project I pull in all the compiled .class files from each project and build the ear.

To solve 1) I envisioned doing three separate <javac> calls in the final build.xml file. Each to each of the projects.
This isn't hard, but I wonder if there is a better way to do this.

To solve 2) assuming I implement solution to 1 above, I wanted to override the jre that ant defaults to using.
by defining . but this causes an error in ant javac

I have read the ant manual I use ant version 1.6.5. Must I create a class that implements CompilerAdapter and point it to the IBMjre? If so is there any guidance on doing so?
would I be better off to upgrade my version of ant?

Please gurus of ANT give me guidance.

Really the source of many problems is WAS, and what I must do to get this project working with ILOG JRules. If you have any pointers, suggestions, knowledge to share or where I can gather more information It will be greatly appreciated.

THANK YOU for your time and effort.

Saloon Keeper
Posts: 27933
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I don't know where you're getting this "customized JRE 1.4" thing. WAS 6.1 comes with JDK 1.5 and the actual JVM is fully Sun-certified, not some custom thingy. The only "custom" is the support JARs, and that's no more custom than any other J2EE platform implementation would be.

I had a nice little talk with IBM recently, and they support both 2 separate JVM options on WAS, although they said that the J9 JVM was the way to go for performance and portability.

You do not have to compile Java using the same JVM that it will run under. That's part of the point of Java compiling to bytecode. Write once, run anywhere. However, you do have to have compatible Java version levels.

Fortunately, since Sun isn't Microsoft, there's backwards compatibility. Using the proper Ant settings you can select what java source level you're expecting and what JVM version the compiled bytecodes will be for.

If you're using J9, there are versions for the different IBM platforms, and I was assured that the Intel and iSeries J9 compilers and runtimes were totally inter-compatible, so it's not a bad idea to pull a copy onto your build systems and configure Ant to use it. But it's not 100% essential.
Forget this weirdo. You guys wanna see something really neat? I just have to take off my shoe .... (hint: it's a tiny ad)
We need your help - Coderanch server fundraiser
    Bookmark Topic Watch Topic
  • New Topic