1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 
28 // MARKER(update_precomp.py): autogen include statement, do not remove
29 #include "precompiled_jvmfwk.hxx"
30 
31 #include "osl/thread.h"
32 #include "otherjre.hxx"
33 
34 using namespace rtl;
35 using namespace std;
36 
37 
38 namespace jfw_plugin
39 {
40 
41 Reference<VendorBase> OtherInfo::createInstance()
42 {
43     return new OtherInfo;
44 }
45 
46 
47 char const* const* OtherInfo::getJavaExePaths(int * size)
48 {
49     static char const * ar[] = {
50 #if defined(WNT) || defined(OS2)
51         "bin/java.exe",
52         "jre/bin/java.exe"
53 #elif UNX
54         "bin/java",
55         "jre/bin/java"
56 #endif
57     };
58         *size = sizeof (ar) / sizeof (char*);
59     return ar;
60 }
61 
62 char const* const* OtherInfo::getRuntimePaths(int * size)
63 {
64     static char const* ar[]= {
65 #if defined(WNT)
66         "/bin/client/jvm.dll",
67         "/bin/hotspot/jvm.dll",
68         "/bin/classic/jvm.dll",
69 	"/bin/jrockit/jvm.dll"
70 #elif defined(OS2)
71         "/bin/classic/jvm.dll",
72         "/bin/client/jvm.dll",
73         "/bin/hotspot/jvm.dll"
74 #elif UNX
75 #ifdef MACOSX
76         "/../../../../../Frameworks/JavaVM.framework/JavaVM"  //as of  1.6.0_22
77 #else
78         "/lib/" JFW_PLUGIN_ARCH "/client/libjvm.so", // for Blackdown PPC
79         "/lib/" JFW_PLUGIN_ARCH "/server/libjvm.so", // for Blackdown AMD64
80         "/lib/" JFW_PLUGIN_ARCH "/classic/libjvm.so", // for Blackdown PPC
81         "/lib/" JFW_PLUGIN_ARCH "/jrockit/libjvm.so", // for Java of BEA Systems
82         "/bin/classic/libjvm.so", // fallback for older for IBM Java
83         "/jre/bin/classic/libjvm.so" // fallback for older for IBM Java
84 #endif
85 #endif
86 
87     };
88     *size = sizeof(ar) / sizeof (char*);
89     return ar;
90 }
91 
92 char const* const* OtherInfo::getLibraryPaths(int* size)
93 {
94 
95 #ifdef UNX
96     static char const * ar[] = {
97 #ifdef MACOSX
98         //mac version does not have a ld library path anymore
99 #else
100         "/bin",
101         "/jre/bin",
102         "/bin/classic",
103         "/jre/bin/classic",
104         "/lib/" JFW_PLUGIN_ARCH "/client",
105         "/lib/" JFW_PLUGIN_ARCH "/server",
106         "/lib/" JFW_PLUGIN_ARCH "/classic",
107         "/lib/" JFW_PLUGIN_ARCH "/jrockit",
108         "/lib/" JFW_PLUGIN_ARCH "/native_threads",
109         "/lib/" JFW_PLUGIN_ARCH
110 #endif
111     };
112 
113     *size = sizeof(ar) / sizeof (char*);
114     return ar;
115 #else
116     size = 0;
117     return NULL;
118 #endif
119 }
120 
121 int OtherInfo::compareVersions(const rtl::OUString& /*sSecond*/) const
122 {
123     //Need to provide an own algorithm for comparing version.
124     //Because this function returns always 0, which means the version of
125     //this JRE and the provided version "sSecond" are equal, one cannot put
126     //any excludeVersion entries in the javavendors.xml file.
127     return 0;
128 }
129 
130 }
131