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_jvmfwk.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 
37 Reference<VendorBase> OtherInfo::createInstance()
38 {
39     return new OtherInfo;
40 }
41 
42 
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 
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/hotspot/jvm.dll",
64         "/bin/classic/jvm.dll",
65 	"/bin/jrockit/jvm.dll"
66 #elif defined(OS2)
67         "/bin/classic/jvm.dll",
68         "/bin/client/jvm.dll",
69         "/bin/hotspot/jvm.dll"
70 #elif UNX
71 #ifdef MACOSX
72         "/../../../../../Frameworks/JavaVM.framework/JavaVM"  //as of  1.6.0_22
73 #else
74         "/lib/" JFW_PLUGIN_ARCH "/client/libjvm.so", // for Blackdown PPC
75         "/lib/" JFW_PLUGIN_ARCH "/server/libjvm.so", // for Blackdown AMD64
76         "/lib/" JFW_PLUGIN_ARCH "/classic/libjvm.so", // for Blackdown PPC
77         "/lib/" JFW_PLUGIN_ARCH "/jrockit/libjvm.so", // for Java of BEA Systems
78         "/bin/classic/libjvm.so", // fallback for older for IBM Java
79         "/jre/bin/classic/libjvm.so" // fallback for older for IBM Java
80 #endif
81 #endif
82 
83     };
84     *size = sizeof(ar) / sizeof (char*);
85     return ar;
86 }
87 
88 char const* const* OtherInfo::getLibraryPaths(int* size)
89 {
90 
91 #ifdef UNX
92     static char const * ar[] = {
93 #ifdef MACOSX
94         //mac version does not have a ld library path anymore
95 #else
96         "/bin",
97         "/jre/bin",
98         "/bin/classic",
99         "/jre/bin/classic",
100         "/lib/" JFW_PLUGIN_ARCH "/client",
101         "/lib/" JFW_PLUGIN_ARCH "/server",
102         "/lib/" JFW_PLUGIN_ARCH "/classic",
103         "/lib/" JFW_PLUGIN_ARCH "/jrockit",
104         "/lib/" JFW_PLUGIN_ARCH "/native_threads",
105         "/lib/" JFW_PLUGIN_ARCH
106 #endif
107     };
108 
109     *size = sizeof(ar) / sizeof (char*);
110     return ar;
111 #else
112     size = 0;
113     return NULL;
114 #endif
115 }
116 
117 int OtherInfo::compareVersions(const rtl::OUString& /*sSecond*/) const
118 {
119     //Need to provide an own algorithm for comparing version.
120     //Because this function returns always 0, which means the version of
121     //this JRE and the provided version "sSecond" are equal, one cannot put
122     //any excludeVersion entries in the javavendors.xml file.
123     return 0;
124 }
125 
126 }
127