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