Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
5 : * This Source Code Form is subject to the terms of the Mozilla Public
6 : * License, v. 2.0. If a copy of the MPL was not distributed with this
7 : * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 : *
9 : * This file incorporates work covered by the following license notice:
10 : *
11 : * Licensed to the Apache Software Foundation (ASF) under one or more
12 : * contributor license agreements. See the NOTICE file distributed
13 : * with this work for additional information regarding copyright
14 : * ownership. The ASF licenses this file to you under the Apache
15 : * License, Version 2.0 (the "License"); you may not use this file
16 : * except in compliance with the License. You may obtain a copy of
17 : * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 : */
19 :
20 :
21 : #include "osl/thread.h"
22 : #include "otherjre.hxx"
23 :
24 : using namespace std;
25 :
26 : using ::rtl::Reference;
27 : namespace jfw_plugin
28 : {
29 :
30 0 : Reference<VendorBase> OtherInfo::createInstance()
31 : {
32 0 : return new OtherInfo;
33 : }
34 :
35 :
36 0 : char const* const* OtherInfo::getJavaExePaths(int * size)
37 : {
38 : static char const * ar[] = {
39 : #if defined(WNT)
40 : "bin/java.exe",
41 : "jre/bin/java.exe"
42 : #elif defined UNX
43 : "bin/java",
44 : "jre/bin/java"
45 : #endif
46 : };
47 0 : *size = sizeof (ar) / sizeof (char*);
48 0 : return ar;
49 : }
50 :
51 0 : char const* const* OtherInfo::getRuntimePaths(int * size)
52 : {
53 : static char const* ar[]= {
54 : #if defined(WNT)
55 : "/bin/client/jvm.dll",
56 : "/bin/hotspot/jvm.dll",
57 : "/bin/classic/jvm.dll",
58 : "/bin/jrockit/jvm.dll",
59 : "/bin/server/jvm.dll" // needed by Azul
60 : #elif defined UNX
61 : #ifdef MACOSX
62 : "/../../../../../Frameworks/JavaVM.framework/JavaVM", //as of 1.6.0_22
63 : "/lib/server/libjvm.dylib" // needed by Azul
64 : #else
65 : "/lib/" JFW_PLUGIN_ARCH "/client/libjvm.so", // for Blackdown PPC
66 : "/lib/" JFW_PLUGIN_ARCH "/server/libjvm.so", // for Blackdown AMD64
67 : "/lib/" JFW_PLUGIN_ARCH "/classic/libjvm.so", // for Blackdown PPC
68 : "/lib/" JFW_PLUGIN_ARCH "/jrockit/libjvm.so", // for Java of BEA Systems
69 : "/bin/classic/libjvm.so", // fallback for older for IBM Java
70 : "/jre/bin/classic/libjvm.so" // fallback for older for IBM Java
71 : #endif
72 : #endif
73 :
74 : };
75 0 : *size = sizeof(ar) / sizeof (char*);
76 0 : return ar;
77 : }
78 :
79 0 : char const* const* OtherInfo::getLibraryPaths(int* size)
80 : {
81 :
82 : #if defined(UNX) && !defined(MACOSX)
83 : //mac version does not have a ld library path anymore
84 : static char const * ar[] = {
85 : "/bin",
86 : "/jre/bin",
87 : "/bin/classic",
88 : "/jre/bin/classic",
89 : "/lib/" JFW_PLUGIN_ARCH "/client",
90 : "/lib/" JFW_PLUGIN_ARCH "/server",
91 : "/lib/" JFW_PLUGIN_ARCH "/classic",
92 : "/lib/" JFW_PLUGIN_ARCH "/jrockit",
93 : "/lib/" JFW_PLUGIN_ARCH "/native_threads",
94 : "/lib/" JFW_PLUGIN_ARCH
95 : };
96 :
97 0 : *size = sizeof(ar) / sizeof (char*);
98 0 : return ar;
99 : #else
100 : *size = 0;
101 : return NULL;
102 : #endif
103 : }
104 :
105 0 : int OtherInfo::compareVersions(const OUString& /*sSecond*/) const
106 : {
107 : //Need to provide an own algorithm for comparing version.
108 : //Because this function returns always 0, which means the version of
109 : //this JRE and the provided version "sSecond" are equal, one cannot put
110 : //any excludeVersion entries in the javavendors.xml file.
111 0 : return 0;
112 : }
113 :
114 : }
115 :
116 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|