2

我的应用程序出现以下错误,

错误:

System.TypeInitializationException: The type initializer for 'java.util.Locale' threw an exception. ---> java.lang.UnsatisfiedLinkError: Unable to load DLL 'vjsnativ': The specified module could not be found. (Exception from HRESULT: 0x8007007E) ---> System.DllNotFoundException: Unable to load DLL 'vjsnativ': The specified module could not be found. (Exception from HRESULT: 0x8007007E)
   at com.ms.vjsharp.windowing.win32.UnsafeWin32Calls.GetLocaleInfo<PInvokeHelper>vjsnativ(Int32 lcid, Int32 lctype, StringBuilder lpLCData, Int32 cchData)
   at com.ms.vjsharp.windowing.win32.UnsafeWin32Calls.GetLocaleInfo(Int32 lcid, Int32 lctype, StringBuffer lpLCData, Int32 cchData)
   at java.util.Locale..ctor(CultureInfo ci, String language, String ctryRgn, String variant)
   at java.util.Locale..ctor(String languageCode, String ctryRgnCode)
   at java.util.Locale..cctor()
   --- End of inner exception stack trace ---
   at java.lang.ExceptionInInitializerError.checkAndThrowException(Throwable thrown)
   at java.util.Locale..cctor()
   --- End of inner exception stack trace ---
   at java.util.Locale.getDefault()
   at com.ms.vjsharp.lang.StringImpl.toUpperCase(String mrString)
   at com.vividsolutions.jts.io.WKTReader.getNextWord(StreamTokenizer tokenizer)
   at com.vividsolutions.jts.io.WKTReader.readGeometryTaggedText(StreamTokenizer tokenizer)
   at com.vividsolutions.jts.io.WKTReader.read(Reader reader)
   at com.vividsolutions.jts.io.WKTReader.read(String wellKnownText)

我正在使用.net 2.0,windows xp os。请检查并让我知道您的答案和建议。

谢谢

4

1 回答 1

0

您可以找到 vjsnativ.dll 并将其复制到您的应用程序目录,或者您可以在调用任何 J# 代码之前添加此代码。

// This problem started with .NET 4
if (Environment.Version.Major >= 4)
{
    string dllpath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.System), @"..\Microsoft.NET\Framework\v2.0.50727");
    dllpath = Path.GetFullPath(dllpath);
    LoadLibrary(Path.Combine(dllpath, "vjsnativ.dll"));
}
// J# code should work now
于 2013-07-04T17:35:52.090 回答