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