136f55ffcSAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
336f55ffcSAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
436f55ffcSAndrew Rist  * or more contributor license agreements.  See the NOTICE file
536f55ffcSAndrew Rist  * distributed with this work for additional information
636f55ffcSAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
736f55ffcSAndrew Rist  * to you under the Apache License, Version 2.0 (the
836f55ffcSAndrew Rist  * "License"); you may not use this file except in compliance
936f55ffcSAndrew Rist  * with the License.  You may obtain a copy of the License at
1036f55ffcSAndrew Rist  *
1136f55ffcSAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
1236f55ffcSAndrew Rist  *
1336f55ffcSAndrew Rist  * Unless required by applicable law or agreed to in writing,
1436f55ffcSAndrew Rist  * software distributed under the License is distributed on an
1536f55ffcSAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
1636f55ffcSAndrew Rist  * KIND, either express or implied.  See the License for the
1736f55ffcSAndrew Rist  * specific language governing permissions and limitations
1836f55ffcSAndrew Rist  * under the License.
1936f55ffcSAndrew Rist  *
2036f55ffcSAndrew Rist  *************************************************************/
2136f55ffcSAndrew Rist 
2236f55ffcSAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir // MARKER(update_precomp.py): autogen include statement, do not remove
25cdf0e10cSrcweir #include "precompiled_jvmfwk.hxx"
26cdf0e10cSrcweir 
27cdf0e10cSrcweir #include "osl/thread.h"
28cdf0e10cSrcweir #include "otherjre.hxx"
29cdf0e10cSrcweir 
30cdf0e10cSrcweir using namespace rtl;
31cdf0e10cSrcweir using namespace std;
32cdf0e10cSrcweir 
33cdf0e10cSrcweir 
34cdf0e10cSrcweir namespace jfw_plugin
35cdf0e10cSrcweir {
36cdf0e10cSrcweir 
createInstance()37cdf0e10cSrcweir Reference<VendorBase> OtherInfo::createInstance()
38cdf0e10cSrcweir {
39cdf0e10cSrcweir     return new OtherInfo;
40cdf0e10cSrcweir }
41cdf0e10cSrcweir 
42cdf0e10cSrcweir 
getJavaExePaths(int * size)43cdf0e10cSrcweir char const* const* OtherInfo::getJavaExePaths(int * size)
44cdf0e10cSrcweir {
45cdf0e10cSrcweir     static char const * ar[] = {
46cdf0e10cSrcweir #if defined(WNT) || defined(OS2)
47cdf0e10cSrcweir         "bin/java.exe",
48cdf0e10cSrcweir         "jre/bin/java.exe"
49cdf0e10cSrcweir #elif UNX
50cdf0e10cSrcweir         "bin/java",
51cdf0e10cSrcweir         "jre/bin/java"
52cdf0e10cSrcweir #endif
53cdf0e10cSrcweir     };
54cdf0e10cSrcweir         *size = sizeof (ar) / sizeof (char*);
55cdf0e10cSrcweir     return ar;
56cdf0e10cSrcweir }
57cdf0e10cSrcweir 
getRuntimePaths(int * size)58cdf0e10cSrcweir char const* const* OtherInfo::getRuntimePaths(int * size)
59cdf0e10cSrcweir {
60cdf0e10cSrcweir     static char const* ar[]= {
61cdf0e10cSrcweir #if defined(WNT)
62cdf0e10cSrcweir         "/bin/client/jvm.dll",
63cdf0e10cSrcweir         "/bin/hotspot/jvm.dll",
64cdf0e10cSrcweir         "/bin/classic/jvm.dll",
65cdf0e10cSrcweir 	"/bin/jrockit/jvm.dll"
66cdf0e10cSrcweir #elif defined(OS2)
67cdf0e10cSrcweir         "/bin/classic/jvm.dll",
68cdf0e10cSrcweir         "/bin/client/jvm.dll",
69cdf0e10cSrcweir         "/bin/hotspot/jvm.dll"
70cdf0e10cSrcweir #elif UNX
71cdf0e10cSrcweir #ifdef MACOSX
72cdf0e10cSrcweir         "/../../../../../Frameworks/JavaVM.framework/JavaVM"  //as of  1.6.0_22
73cdf0e10cSrcweir #else
74cdf0e10cSrcweir         "/lib/" JFW_PLUGIN_ARCH "/client/libjvm.so", // for Blackdown PPC
75cdf0e10cSrcweir         "/lib/" JFW_PLUGIN_ARCH "/server/libjvm.so", // for Blackdown AMD64
76cdf0e10cSrcweir         "/lib/" JFW_PLUGIN_ARCH "/classic/libjvm.so", // for Blackdown PPC
77cdf0e10cSrcweir         "/lib/" JFW_PLUGIN_ARCH "/jrockit/libjvm.so", // for Java of BEA Systems
78*9fbe0120SDamjan Jovanovic         "/lib/server/libjvm.so",                     // > 1.8
79cdf0e10cSrcweir         "/bin/classic/libjvm.so", // fallback for older for IBM Java
80cdf0e10cSrcweir         "/jre/bin/classic/libjvm.so" // fallback for older for IBM Java
81cdf0e10cSrcweir #endif
82cdf0e10cSrcweir #endif
83cdf0e10cSrcweir 
84cdf0e10cSrcweir     };
85cdf0e10cSrcweir     *size = sizeof(ar) / sizeof (char*);
86cdf0e10cSrcweir     return ar;
87cdf0e10cSrcweir }
88cdf0e10cSrcweir 
getLibraryPaths(int * size)89cdf0e10cSrcweir char const* const* OtherInfo::getLibraryPaths(int* size)
90cdf0e10cSrcweir {
91cdf0e10cSrcweir 
92cdf0e10cSrcweir #ifdef UNX
93cdf0e10cSrcweir     static char const * ar[] = {
94cdf0e10cSrcweir #ifdef MACOSX
95cdf0e10cSrcweir         //mac version does not have a ld library path anymore
96cdf0e10cSrcweir #else
97cdf0e10cSrcweir         "/bin",
98cdf0e10cSrcweir         "/jre/bin",
99cdf0e10cSrcweir         "/bin/classic",
100cdf0e10cSrcweir         "/jre/bin/classic",
101cdf0e10cSrcweir         "/lib/" JFW_PLUGIN_ARCH "/client",
102cdf0e10cSrcweir         "/lib/" JFW_PLUGIN_ARCH "/server",
103cdf0e10cSrcweir         "/lib/" JFW_PLUGIN_ARCH "/classic",
104cdf0e10cSrcweir         "/lib/" JFW_PLUGIN_ARCH "/jrockit",
105cdf0e10cSrcweir         "/lib/" JFW_PLUGIN_ARCH "/native_threads",
106*9fbe0120SDamjan Jovanovic         "/lib/" JFW_PLUGIN_ARCH,
107*9fbe0120SDamjan Jovanovic         "/lib" // > 1.8
108cdf0e10cSrcweir #endif
109cdf0e10cSrcweir     };
110cdf0e10cSrcweir 
111cdf0e10cSrcweir     *size = sizeof(ar) / sizeof (char*);
112cdf0e10cSrcweir     return ar;
113cdf0e10cSrcweir #else
114cdf0e10cSrcweir     size = 0;
115cdf0e10cSrcweir     return NULL;
116cdf0e10cSrcweir #endif
117cdf0e10cSrcweir }
118cdf0e10cSrcweir 
compareVersions(const rtl::OUString &) const119cdf0e10cSrcweir int OtherInfo::compareVersions(const rtl::OUString& /*sSecond*/) const
120cdf0e10cSrcweir {
121cdf0e10cSrcweir     //Need to provide an own algorithm for comparing version.
122cdf0e10cSrcweir     //Because this function returns always 0, which means the version of
123cdf0e10cSrcweir     //this JRE and the provided version "sSecond" are equal, one cannot put
124cdf0e10cSrcweir     //any excludeVersion entries in the javavendors.xml file.
125cdf0e10cSrcweir     return 0;
126cdf0e10cSrcweir }
127cdf0e10cSrcweir 
128cdf0e10cSrcweir }
129