X
PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 26 Mar 2013 08:50 AM by  anon
Changing The Java Runtime in IDL 8.2 on OSX
 1 Replies
Sort:
You are not authorized to post a reply.
Author Messages

anon



New Member


Posts:
New Member


--
26 Mar 2013 08:50 AM
    In order to use some of our latest libraries built with Java7, we've attempted to configure IDL to adopt the latest JRE. Java6 has reached EOL: https://blogs.oracle.com/henrik/entry/java_6_eol_h_h We've had some success when it comes to following to documentation listed on the IDL Connectivity Bridges: http://www.exelisvis.com/docs/pdf/bridges.pdf On Windows, one must simply change the config file to point to the appropriate JDK. According to the documentation, the OSX version of IDL ignores both the JVM LibLocation in .idljavabrc and the environment variable IDLJAVAB_LIB_LOCATION. "On Macintosh platforms, IDL uses the JVM provided by the operating system, and ignores the value of the IDLJAVAB_LIB_LOCATION environment variable." It appears to always assign the first "System" JRE which is outdated. This is confirmed by: oBridgeSession = OBJ_NEW("IDLJavaObject$IDLJAVABRIDGESESSION") oJVersion = oBridgeSession -> GetVersionObject() print, "Java Version: ", oJVersion->GetJavaVersion() ;Displays system JRE. The System Java is stored in /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home while the Oracle Java is stored /Library/Java/JavaVirtualMachines/1.7.0.jdk/Contents/Home Using the Java Preferences in /Applications/Utilities yields the correct java -version in the terminal as well as running /usr/libexec/java_home produces the correct java home. But, these processes seem to change environment variables which IDL ignores. Is there another way to configure IDL in OSX to use a custom path for the IDL->Java Bridge JRE?

    Deleted User



    New Member


    Posts:
    New Member


    --
    03 Apr 2013 03:52 PM
    I am afraid that you will not be able to change the version of Java used by IDL (or the IDL workbench ) on Mac OS X. On this platform, you must use Java 1.6 with the workbench and IDL java bridges.. On Windows and Linux, changing the java version is a pretty straightforward process(*). The issue on Mac OS X seems to stem from the fact that the Eclipse version used by the IDL workbench appears to have something embedded in it that requires Java 1.6 (though the same problem seems to occur when calling java bridges from command-line IDL). When we were testing this issue, we found a few cases online where people were able to workaround the problem. However, these workarounds failed for us when we tried them with IDL. A couple of links we found are shown below: http://apple.stackexchange.com/questi... http://hphamb.blogspot.com/2012/09/in... If you have access to the Java source code, I would recommend recompiling the code to work with Java 1.6. If your program won't work with Java 1.6, then you might consider using SPAWN to execute the code from IDL and writing the output to a file. (*) On Linux and Windows you can change the version of Java used by the workbench by modifying "idlde.ini" file. In this file, change the path under the "-vm" argument to point to the directory that the jre bin directory for the other version of java. For command-line IDL, you can modify the javabrc file in the "resource/bridges/import/java" directory of the IDL installation. David Technical Support Engineer Exelis Vis
    You are not authorized to post a reply.