To Err is Java,to Forgive Oscript

The first time I learned that a piece of java code could be called from Oscript was in 2005.This was closely after the debacle of the Java Modules development that OT wanted people to follow.Not sure what the programming paradigm was but to me it looked like you would do Java coding and oscript coding simultaneouslytto get something done.In any case it died a natural death and we are not discussing here.The Home RH which is remnant is what people would remember of that.

We are discussing Oscript to Java Bridge which is a great help to you if you wanted to do something.That somethings could be

  1. Call a web Service form oscript bypassing the socket stuff
  2. Whatever you could get java to do and get it to use in livelink

Now Hans stoop of OT Germany was the first person to tell the developer world this and people started on that in earnest.I was a natural taker and I basically took Rolf Poser’s approach which     was a oscript module that spit out some java strings.Naturally to learn I created a Request Handler and put it for general consumption 

Notice I have given all credits where it is due as these good programmers have kept the OT programming environment proactively upward without which it would be a very sorry affair.Now for newer developers if there is no time to research anything then you have only you to blame.For one thing I think if you do not understand class paths and if you cannot understand how java code works and thought Eclipse and Netbeans were there from day one,I reserve my comments.I still like to use a notepad to write java code and compile them.Enough of digression here is the quick things you need to do.

  1. Always True Statement #1-Builder IDE does not load the JVM by default.You have to “tweak” the builder shortcut.It is basically written in the builder documentation as well as in several other published examples
  2. Always True Statement #2-Livelink is going to use the JRE, again JRE that ships with the livelink application so make sure your code is compiled on that  JVM. See JVM’s in 9.7.1 and 10 in my screen caps.
  3. Always True Statement #3-The class loader of service and builder is different,which brings me to my acronym OMH(Over My Head) see these threads where java people talk about it.I always make sure I can see ‘Hello World’  in my builder output.The ‘HelloWorld’ e.g settles the environment problems and then we can think of Relections et al.

Link to a word document with screen caps and some important links

As time permits I will see if I can put up an example for doing something with Java on CS10

BTW Java is a great language but do understand that the world was not built by Java although increasingly OT is moving things that really don’t belong in livelink to java based offerings. A java coup d’état    ? We  have seen OTDS and then Oclipse…. H’mm sounds fishy to me.


One thought on “To Err is Java,to Forgive Oscript

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.