1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: sunjre.cxx,v $
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"
36 #include "sunversion.hxx"
37 #include "diagnostics.h"
42 #define OUSTR(x) ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(x) )
46 Reference
<VendorBase
> SunInfo::createInstance()
51 char const* const* SunInfo::getJavaExePaths(int * size
)
53 static char const * ar
[] = {
54 #if defined(WNT) || defined(OS2)
64 *size
= sizeof (ar
) / sizeof (char*);
68 char const* const* SunInfo::getRuntimePaths(int * size
)
70 static char const* ar
[]= {
72 "/bin/client/jvm.dll",
73 "/bin/hotspot/jvm.dll",
74 "/bin/classic/jvm.dll"
76 "/bin/classic/jvm.dll",
78 "/lib/" JFW_PLUGIN_ARCH
"/client/libjvm.so",
79 "/lib/" JFW_PLUGIN_ARCH
"/server/libjvm.so",
80 "/lib/" JFW_PLUGIN_ARCH
"/classic/libjvm.so"
84 *size
= sizeof(ar
) / sizeof (char*);
88 char const* const* SunInfo::getLibraryPaths(int* size
)
91 static char const * ar
[] = {
93 "/lib/" JFW_PLUGIN_ARCH
"/client",
94 "/lib/" JFW_PLUGIN_ARCH
"/native_threads",
95 "/lib/" JFW_PLUGIN_ARCH
98 *size
= sizeof(ar
) / sizeof (char*);
106 int SunInfo::compareVersions(const rtl::OUString
& sSecond
) const
108 OUString sFirst
= getVersion();
110 SunVersion
version1(sFirst
);
111 JFW_ENSURE(version1
, OUSTR("[Java framework] sunjavaplugin"SAL_DLLEXTENSION
112 " does not know the version: ")
113 + sFirst
+ OUSTR(" as valid for a SUN JRE."));
114 SunVersion
version2(sSecond
);
116 throw MalformedVersionException();
118 if(version1
== version2
)
120 if(version1
> version2
)