首页 \ 问答 \ Java webstart在windows上加载linux swt jar(Java webstart loading linux swt jars on windows)

Java webstart在windows上加载linux swt jar(Java webstart loading linux swt jars on windows)

我有一个java webstart应用程序,它使用swt作为界面(包括DJ Native Swing)。 该应用程序在Windows上运行良好,直到我尝试将linux和mac osx swt jar添加到应用程序以支持这些平台。 当从netbeans启动时,应用程序在linux下运行正常,只有正确的jar链接,但是当在任何平台上通过java webstart启动应用程序时,似乎加载了错误的jar文件。

这是我在launch.jnlp(以及其他内容)中的内容:

<resources os="Windows" arch="x86">
    <j2se java-vm-args="-Xmx512m" version="1.5+"/>
    <jar href="lib/swt-win32-x86.jar"/>
    <nativelib href="lib/swt-win32-x86.jar"/>
</resources>

<resources os="Windows" arch="x86_64">
    <j2se java-vm-args="-Xmx512m" version="1.5+"/>
    <jar href="lib/swt-win32-x86_64.jar"/>
    <nativelib href="lib/swt-win32-x86_64.jar"/>
</resources>

<resources os="Windows" arch="amd64">
    <j2se java-vm-args="-Xmx512m" version="1.5+"/>
    <jar href="lib/swt-win32-x86_64.jar"/>
    <nativelib href="lib/swt-win32-x86_64.jar"/>
</resources>

<resources os="Linux" arch="i386">
    <j2se java-vm-args="-Xmx512m" version="1.5+"/>
    <jar href="lib/swt-linux-x86.jar"/>
    <nativelib href="lib/swt-linux-x86.jar"/>
</resources>

<resources os="Linux" arch="amd64">
    <j2se java-vm-args="-Xmx512m" version="1.5+"/>
    <jar href="lib/swt-linux-x86_64.jar"/>
    <nativelib href="lib/swt-linux-x86_64.jar"/>
</resources>

<resources os="Mac OS X" arch="x86_64">
    <j2se java-vm-args="-XstartOnFirstThread -Xmx512m" version="1.5+"/>
    <jar href="lib/swt-macos-x86_64.jar"/>
</resources>

<resources os="Mac OS X" arch="x86">
    <j2se java-vm-args="-XstartOnFirstThread -Xmx512m" version="1.5+"/>
    <jar href="lib/swt-macos.jar"/>
</resources> 

如果我理解正确,这应该导致窗口(取决于拱门)只加载swt-win32-x86.jar。 但是当我在Windows 7 64bit上启动应用程序,但是使用32位jvm时,我收到以下错误:NativeSwing [1]:引起:java.lang.UnsatisfiedLinkError:无法加载SWT库。 理由:NativeSwing [1]:java.library.path中没有swt-gtk-4234 NativeSwing [1]:java.library.path中没有swt-gtk NativeSwing [1]:无法加载库:C:\ Users \ dolf.swt \ lib \ win32 \ x86 \ swt-gtk-4234.dll NativeSwing [1]:无法加载库:C:\ Users \ dolf.swt \ lib \ win32 \ x86 \ swt-gtk.dll

当然,在Windows上找不到swt-gtk,它只应该在Linux上使用。 如果我在java的临时Internet文件查看器下检查java控制面板中的Resources,我确实看到java webstart已经下载了swt-linux-x86.jar和swt-win32-x86.jar。 显然,java webstart正在下载错误的jar文件。

我希望有人知道为什么会出错。


I have a java webstart application which uses swt for the interface (and includes DJ Native Swing). The application runs fine on windows, until I try to add the linux and mac osx swt jars to the application in order to support those platforms. The application runs fine under linux when started from netbeans with only the correct jars linked, but when launching the application through java webstart on any platform, it seems the wrong jar files are loaded.

This is what i have in my launch.jnlp (among other stuff):

<resources os="Windows" arch="x86">
    <j2se java-vm-args="-Xmx512m" version="1.5+"/>
    <jar href="lib/swt-win32-x86.jar"/>
    <nativelib href="lib/swt-win32-x86.jar"/>
</resources>

<resources os="Windows" arch="x86_64">
    <j2se java-vm-args="-Xmx512m" version="1.5+"/>
    <jar href="lib/swt-win32-x86_64.jar"/>
    <nativelib href="lib/swt-win32-x86_64.jar"/>
</resources>

<resources os="Windows" arch="amd64">
    <j2se java-vm-args="-Xmx512m" version="1.5+"/>
    <jar href="lib/swt-win32-x86_64.jar"/>
    <nativelib href="lib/swt-win32-x86_64.jar"/>
</resources>

<resources os="Linux" arch="i386">
    <j2se java-vm-args="-Xmx512m" version="1.5+"/>
    <jar href="lib/swt-linux-x86.jar"/>
    <nativelib href="lib/swt-linux-x86.jar"/>
</resources>

<resources os="Linux" arch="amd64">
    <j2se java-vm-args="-Xmx512m" version="1.5+"/>
    <jar href="lib/swt-linux-x86_64.jar"/>
    <nativelib href="lib/swt-linux-x86_64.jar"/>
</resources>

<resources os="Mac OS X" arch="x86_64">
    <j2se java-vm-args="-XstartOnFirstThread -Xmx512m" version="1.5+"/>
    <jar href="lib/swt-macos-x86_64.jar"/>
</resources>

<resources os="Mac OS X" arch="x86">
    <j2se java-vm-args="-XstartOnFirstThread -Xmx512m" version="1.5+"/>
    <jar href="lib/swt-macos.jar"/>
</resources> 

If I understand correctly, this should result in on windows (depending on the arch) only the swt-win32-x86.jar being loaded. But when I launch the application on windows 7 64bit, but with a 32bit jvm I get the following error: NativeSwing[1]: Caused by: java.lang.UnsatisfiedLinkError: Could not load SWT library. Reasons: NativeSwing[1]: no swt-gtk-4234 in java.library.path NativeSwing[1]: no swt-gtk in java.library.path NativeSwing[1]: Can't load library: C:\Users\dolf.swt\lib\win32\x86\swt-gtk-4234.dll NativeSwing[1]: Can't load library: C:\Users\dolf.swt\lib\win32\x86\swt-gtk.dll

Of course no swt-gtk can be found on Windows, it should only be needed on Linux. If I check the Resources in the java control panel under the temporary internet files viewer of java, I indeed see both swt-linux-x86.jar and swt-win32-x86.jar have been downloaded by java webstart. Clearly, java webstart is downloading the wrong jar files.

I hope anyone has an idea why this is going wrong.


原文:https://stackoverflow.com/questions/16065539
更新时间:2022-08-21 09:08

最满意答案

我刚刚找到原因,实际上它是在文本模式下上传,一旦我们将其更改为二进制模式。 它工作正常。


I just found out the reason, actually it was being uploaded in the text mode, once we changed it to Binary mode. It worked fine.

相关问答

更多
  • 好的,所以我觉得有点蠢。 但我想出来 我几乎在顶部有: sftp user@host remoteFile localFile 终端中显示的唯一文档是: sftp [user@]host[:file ...] sftp [user@]host[:dir[/]] 但是,我遇到了这个网站 ,其中显示了以下内容: sftp [-vC1 ] [-b batchfile ] [-o ssh_option ] [-s subsystem | sftp_server ] [-B buffer_size ] [-F s ...
  • 没有什么像SFTP URL。 十年前,曾尝试标准化SFTP URL: https://tools.ietf.org/html/draft-ietf-secsh-scp-sftp-ssh-uri-04 而且它从未完成,并且该提案在多年前已过期。 所以,即使JSch能够生成类似于SFTP URL(它不能)的东西,也不知道它是否适用于其他系统,因为没有通用的标准。 您必须自己生成URL,以符合目标系统的专有语法。 我从来没有见过任何可以让你在SFTP URL中指定私钥的软件。 一般来说,您可以将私钥加载到系统可以 ...
  • 只需将php输出重定向到临时文件并上传文件即可。 php yourscript.php > /tmp/file.csv echo "put /tmp/file.csv" | sftp user@example.com 如果你想在没有临时文件的情况下这样做,你不能只使用(OpenSSH) sftp因为它无法读取从stdin上传的内容。 (OpenSSH) scp都不行。 您当然可以从PHP代码本身生成文件,如果这更适合您的任务。 只需使用file_put_contents() : file_put_cont ...
  • 我刚刚找到原因,实际上它是在文本模式下上传,一旦我们将其更改为二进制模式。 它工作正常。 I just found out the reason, actually it was being uploaded in the text mode, once we changed it to Binary mode. It worked fine.
  • 简短的回答 Net::SFTP.start('host', 'user', password: 'pass', port: 22) do |sftp| # Do stuff end 相当于: session = Net::SSH.start('host', 'user', password: 'pass', port: 22) sftp = Net::SFTP::Session.new(session) sftp.connect! # Do stuff sftp.close_channel u ...
  • SFTP使用SSH来传输文件。 如果在远程计算机上运行ssh,则可以将其更改为此值。 我不确定C#是否支持它。 根据这个: http : //social.msdn.microsoft.com/Forums/en-US/netfxnetcom/thread/817b4f71-7e88-4b62-b48a-8a5edca800fd/答案是否定的。 FTPS正在FTP上添加SSL。 有点像HTTPS是HTTP之上的SSL。 您的代码肯定使用FTPS。 您的防火墙问题可能在此解释: http : //en.wik ...
  • 您可以选择编码为US ASCII 转到您的SFTP连接器> 高级选项卡>“编码”下拉菜单>选择美国ASCII编码 让我们知道这是否解决了这个问题。 You can choose the encoding as US ASCII Go to your SFTP connector > Advanced tab > "Encoding" drop down > Select Encoding US ASCII Let us know if this resolves the issue.
  • http://phpseclib.sourceforge.net/documentation/intro.html#intro_usage_correct 因此,phpseclib的根目录需要位于include_path中。 从那个页面: 你应该真正熟悉这种包含技术 - 它是PEAR库和Zen ...
  • 您使用的是哪个版本的phpseclib? 你可以发帖吗? 您可以通过define('NET_SSH2_LOGGING', 2)获取日志,然后在完成后获取$ssh->getLog() 。 Which version of phpseclib are you using? Can you post logs? You can get the logs by doing define('NET_SSH2_LOGGING', 2) and then, after you're done, $ssh->getLog( ...
  • 这取决于服务器实现。 权限可以从文件上载的文件夹或通过SSH登录的用户继承。 由于Windows对远程系统权限(默认情况下)一无所知,因此不会复制权限。 请注意,SFTP 4+(如果内存适用于版本)允许您通过SFTP更改权限,这意味着客户端可以在上载文件后设置权限。 This depends on server implementation. Permissions can be inherited from the folder to which the file is uploaded or by th ...

相关文章

更多

最新问答

更多
  • 获取MVC 4使用的DisplayMode后缀(Get the DisplayMode Suffix being used by MVC 4)
  • 如何通过引用返回对象?(How is returning an object by reference possible?)
  • 矩阵如何存储在内存中?(How are matrices stored in memory?)
  • 每个请求的Java新会话?(Java New Session For Each Request?)
  • css:浮动div中重叠的标题h1(css: overlapping headlines h1 in floated divs)
  • 无论图像如何,Caffe预测同一类(Caffe predicts same class regardless of image)
  • xcode语法颜色编码解释?(xcode syntax color coding explained?)
  • 在Access 2010 Runtime中使用Office 2000校对工具(Use Office 2000 proofing tools in Access 2010 Runtime)
  • 从单独的Web主机将图像传输到服务器上(Getting images onto server from separate web host)
  • 从旧版本复制文件并保留它们(旧/新版本)(Copy a file from old revision and keep both of them (old / new revision))
  • 西安哪有PLC可控制编程的培训
  • 在Entity Framework中选择基类(Select base class in Entity Framework)
  • 在Android中出现错误“数据集和渲染器应该不为null,并且应该具有相同数量的系列”(Error “Dataset and renderer should be not null and should have the same number of series” in Android)
  • 电脑二级VF有什么用
  • Datamapper Ruby如何添加Hook方法(Datamapper Ruby How to add Hook Method)
  • 金华英语角.
  • 手机软件如何制作
  • 用于Android webview中图像保存的上下文菜单(Context Menu for Image Saving in an Android webview)
  • 注意:未定义的偏移量:PHP(Notice: Undefined offset: PHP)
  • 如何读R中的大数据集[复制](How to read large dataset in R [duplicate])
  • Unity 5 Heighmap与地形宽度/地形长度的分辨率关系?(Unity 5 Heighmap Resolution relationship to terrain width / terrain length?)
  • 如何通知PipedOutputStream线程写入最后一个字节的PipedInputStream线程?(How to notify PipedInputStream thread that PipedOutputStream thread has written last byte?)
  • python的访问器方法有哪些
  • DeviceNetworkInformation:哪个是哪个?(DeviceNetworkInformation: Which is which?)
  • 在Ruby中对组合进行排序(Sorting a combination in Ruby)
  • 网站开发的流程?
  • 使用Zend Framework 2中的JOIN sql检索数据(Retrieve data using JOIN sql in Zend Framework 2)
  • 条带格式类型格式模式编号无法正常工作(Stripes format type format pattern number not working properly)
  • 透明度错误IE11(Transparency bug IE11)
  • linux的基本操作命令。。。