如何为firefox安装java插件

今天浏览一个网站,尽然需要自己安装java浏览插件,faint,firefox不支持自动安装,没办法只好找找方法,然后记录经历于此:
1、去这里:http://java.com/en/download/linux_manual.jsp 下载最新自解压安装包,其自解压出来的rpm包是不能够直接使用的,要不就直接提供rpm包安装了;
2、使用命令如下:
chmod +x ./jre-1_5_0_09-linux-i586-rpm.bin
./jre-1_5_0_09-linux-i586-rpm.bin

按空格查看下面的条款,然后输入yes安装完毕后,进行下一步;
3、 到firefox/lugins目录(在我的NeoShine-Linux下是 /usr/local/firefox/plugins)或者~/.mozilla/plugins下执行:
ln -s $JAVA_HOME/jre/plugin/i386/ns7/libjavaplugin_oji.so ./
如果是安装的jre,可能命令语句如下:
ln -s $JAVA_HOME/plugin/i386/ns7/libjavaplugin_oji.so
其中JA VA_HOME是JAVA安装的位置了。在我的机器上是/mnt/sda6/software/jre-1.5.0_07。如果是安装的jre就是jre文件夹地址。
这样就安装完成了。可以在firefox地址栏里输入about:plugins查看是否安装成功。
将连接创建在~/.mozilla/plugins下是放在当前用户下,不需要root权限,不影响其他用户。

reference:
http://www.blog.edu.cn/user1/5550/archives/2006/1445430.shtml
http://hi.baidu.com/pyromania/blog/item/6f131d306760f699a9018e14.html
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Java中使用Selenium和Firefox浏览器进行代理设置,可以按照以下步骤进行: 1. 下载Firefox浏览器,并安装FoxyProxy Standard件。 2. 配置FoxyProxy,添加代理服务器地址和端口号,并选择“HTTP代理”类型。 3. 在FoxyProxy的“身份验证”选项卡中,填写代理服务器的用户名和密码,保存设置。 4. 在Java中使用Selenium启动Firefox浏览器,并使用FirefoxProfile设置代理服务器。 5. 在Firefox浏览器中访问需要使用代理服务器的网站,即可自动使用设置好的代理服务器进行访问。 下面是一个示例代码: ``` import org.openqa.selenium.Proxy; import org.openqa.selenium.WebDriver; import org.openqa.selenium.firefox.FirefoxDriver; import org.openqa.selenium.firefox.FirefoxProfile; import org.openqa.selenium.remote.CapabilityType; import org.openqa.selenium.remote.DesiredCapabilities; import org.openqa.selenium.remote.RemoteWebDriver; // 创建FirefoxProfile对象 FirefoxProfile firefoxProfile = new FirefoxProfile(); // 设置代理服务器地址和端口号 String proxyUrl = "http://proxy.server.com:port"; firefoxProfile.setPreference("network.proxy.type", 1); firefoxProfile.setPreference("network.proxy.http", proxyUrl); firefoxProfile.setPreference("network.proxy.http_port", 80); // 设置代理服务器的用户名和密码 String proxyUsername = "username"; String proxyPassword = "password"; firefoxProfile.setPreference("extensions.foxyproxy.proxyPassword", proxyPassword); firefoxProfile.setPreference("extensions.foxyproxy.proxyUsername", proxyUsername); // 启动Firefox浏览器 DesiredCapabilities capabilities = DesiredCapabilities.firefox(); capabilities.setCapability(CapabilityType.PROXY, new Proxy().setHttpProxy(proxyUrl)); WebDriver driver = new FirefoxDriver(capabilities); // 访问需要使用代理服务器的网站 driver.get("https://www.example.com"); ``` 通过以上代码,就可以在Java中使用Selenium和Firefox浏览器进行代理设置。注意,这里使用了FoxyProxy件设置了代理服务器的账号密码,且在Java代码中设置了FirefoxProfile和DesiredCapabilities,来启动Firefox浏览器并设置代理服务器。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值