有没有办法将Java 7安装到USB上,并将其用于eclipse中的项目? [英] Is there a way to install Java 7 onto a USB and use that for projects in eclipse?

查看:346
本文介绍了有没有办法将Java 7安装到USB上,并将其用于eclipse中的项目?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一台电脑和一台笔记本电脑。因为我的代码我把我的eclipse工作区放在USB上。但我的电脑有Java 7和6,但我的笔记本电脑只有Java 6。我想在我的笔记本电脑上使用Java 7。有没有办法把它放在USB上,指向它使用。我已经做了研究,发现了一些关于将JAR添加到库中的东西,但是当我下载Java 7 JDK时,它是在一堆文件夹中。我做错了,还是说完全不同的东西。正如有人提到的那样,



它不是我的笔记本电脑。我的爸爸,他从工作。但是他并没有安装任何东西。包括java 7.哪个是惹恼我,但是为什么我问这个问题。

解决方案

将java安装到eclipse目录(使用文件夹jre / jdk而不是jre7),eclipse会把它取代(或者它在windows上为我做)。



或者编辑eclipse.ini(有一个-VM参数指定java驻留在哪里。)



还可以查看 http://portableapps.com/node/929 http://www.codeproject.com/Articles/417140/Eclipse-on-a-USB-flashdrive






由于对此方法有疑问。
我正在使用Windows Eclipse版本(1.4.1.2),jre7目录被复制到eclipse下的jre。在那里没有更改eclipse.ini。



不幸的是Java安装在我正在使用的机器上,但如果我查看Eclipse配置(帮助>>关于>>配置选项卡),Eclipse说它正在使用F盘(USB)上的jre。如果我重命名jre,那么它将恢复到机器上的java。

  -vm 
F:\eclipse \jre\bin\client\jvm.dll
eclipse.home.location = file:/ F:/ eclipse /
eclipse.launcher = F:\eclipse\eclipse.exe
eclipse.launcher.name = Eclipse
eclipse.p2.data.area=@config.dir /../ p2 /
eclipse.p2.profile = epp.package.java
eclipse.product = org.eclipse.epp.package.java.product
eclipse.startTime = 1365550480114
eclipse.vm = F:\eclipse\jre\bin\client\ jvm.dll
eclipse.vmargs = -Dosgi.requiredJavaVersion = 1.5

......

sun.boot.class.path = F:\\ \\eclipse\jre\lib\resources.jar; F:\eclipse\jre\lib\rt.jar; F:\eclipse\jre\lib\sunrsasign.jar; F: \eclipse\jre\lib\jsse.jar; F:\eclipse\jre\lib\jce.jar; F:\eclipse\jre\lib\charsets.jar;˚F :\eclipse\jre\classes
sun.boot .library.path = F:\eclipse\jre\bin

......


java.endorsed.dirs = F: \eclipse\jre\lib\endorsed
java.ext.dirs = F:\eclipse\jre\lib\ext; C:\Windows\Sun\Java\ lib\ext
java.home = F:\eclipse\jre
java.io.tmpdir = C:\Users\mum\AppData\Local\Temp\
java.library.path = F:\eclipse; C:\Windows\Sun\Java\bin; C:\Windows\system32; C:\Windows; F:/ eclipse / jre / bin / client; F:/ eclipse / jre / bin; F:/ eclipse / jre / lib / i386; C:\Program Files\Common Files\Microsoft Shared\Windows Live; C:\Program文件(x86)\Common Files\Microsoft Shared\Windows Live; C:\Windows\system32; C:\Windows; C:\Windows\System32\Wbem; C:\Windows\\ \\ System32 \ Windows \\ Windows \\ Windows \\ ogram Files\Dell\DW WLAN卡; C:\程序文件(x86)\Common Files\Roxio Shared\DLLShared\; C:\Program文件(x86)\Common Files\Roxio共享\OEM\DLLShared\; C:\程序文件(x86)\Common Files\Roxio Shared\OEM\DLLShared\; C:\Program文件(x86)\Common Files\\ \\ Roxio Shared\OEM\12.0\DLLShared\; C:\Program文件(x86)\Roxio\OEM\AudioCore\; C:\Program Files\WIDCOMM\Bluetooth Software\\ \\; C:\Program Files\WIDCOMM\Bluetooth Software\syswow64; C:\Program Files(x86)\Windows Live\Shared; C:\Program Files\Bruce\jEdit; C :\程序文件(x86)\QuickTime\QTSystem\; c:\Regina; C:\Program Files\TortoiseSVN\bin ;; F:\eclipse ;;。

重命名jre目录后,我得到

  -vm 
C:\Program文件(x86)\Java\jre7\bin\client\jvm.dll
eclipse.home.location = file:/ F:/ eclipse /
eclipse.launcher = F:\eclipse\eclipse.exe
eclipse.launcher.name = Eclipse
eclipse.p2.data.area = @ config.dir /../ p2 /
eclipse.p2.profile = epp.package.java
eclipse.product = org.eclipse.epp.package.java.product
eclipse。 startTime = 1365550310914
eclipse.vm = C:\Program文件(x86)\Java\jre7\bin\client\jvm.dll
eclipse.vmargs = -Dosgi.requiredJavaVersion = 1.5


I have a computer and a Laptop. Because I code on both I put my eclipse workspace on a USB. But my computer has Java 7 and 6, but my laptop only has Java 6. I want to use Java 7 on my laptop too. Is there a way to put it on the USB and point to it to use. I have done research and found something about adding a JAR to a library, but when I download the Java 7 JDK it is in a whole bunch of folders. Am I doing it wrong or is that talking about something completely different.

As some people have mentioned. Its not my laptop entirely. Its my dads that he had from work. However he doesn't let install anything on it. Including java 7. Which does annoy me, but is why I'm asking this question.

解决方案

Install java into the eclipse directory (use folder jre/jdk instead of jre7), eclipse will pick it up (or it did for me on windows).

Alternatively edit eclipse.ini (there is a -VM parameter to specify where java resides).

also look at http://portableapps.com/node/929 or http://www.codeproject.com/Articles/417140/Eclipse-on-a-USB-flashdrive


Since there is some doubt about this method. I am using Windows Eclipse version (1.4.1.2), the jre7 directory was copied to jre under eclipse. There where no changes to eclipse.ini.

Unfortunately Java is installed on the machine I am using, but if I look in Eclipse configuration (Help >> About >> Configuration tab), Eclipse say's it is using the jre on the F drive (USB). If I rename the jre, it reverts to the java on the machine.

-vm
F:\eclipse\jre\bin\client\jvm.dll
eclipse.home.location=file:/F:/eclipse/
eclipse.launcher=F:\eclipse\eclipse.exe
eclipse.launcher.name=Eclipse
eclipse.p2.data.area=@config.dir/../p2/
eclipse.p2.profile=epp.package.java
eclipse.product=org.eclipse.epp.package.java.product
eclipse.startTime=1365550480114
eclipse.vm=F:\eclipse\jre\bin\client\jvm.dll
eclipse.vmargs=-Dosgi.requiredJavaVersion=1.5

   ......

sun.boot.class.path=F:\eclipse\jre\lib\resources.jar;F:\eclipse\jre\lib\rt.jar;F:\eclipse\jre\lib\sunrsasign.jar;F:\eclipse\jre\lib\jsse.jar;F:\eclipse\jre\lib\jce.jar;F:\eclipse\jre\lib\charsets.jar;F:\eclipse\jre\classes
sun.boot.library.path=F:\eclipse\jre\bin

   ......


java.endorsed.dirs=F:\eclipse\jre\lib\endorsed
java.ext.dirs=F:\eclipse\jre\lib\ext;C:\Windows\Sun\Java\lib\ext
java.home=F:\eclipse\jre
java.io.tmpdir=C:\Users\mum\AppData\Local\Temp\
java.library.path=F:\eclipse;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;F:/eclipse/jre/bin/client;F:/eclipse/jre/bin;F:/eclipse/jre/lib/i386;C:\Program Files\Common Files\Microsoft Shared\Windows Live;C:\Program Files (x86)\Common Files\Microsoft Shared\Windows Live;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\ATI Technologies\ATI.ACE\Core-Static;C:\Program Files\Dell\DW WLAN Card;C:\Program Files (x86)\Common Files\Roxio Shared\DLLShared\;C:\Program Files (x86)\Common Files\Roxio Shared\OEM\DLLShared\;C:\Program Files (x86)\Common Files\Roxio Shared\OEM\DLLShared\;C:\Program Files (x86)\Common Files\Roxio Shared\OEM\12.0\DLLShared\;C:\Program Files (x86)\Roxio\OEM\AudioCore\;C:\Program Files\WIDCOMM\Bluetooth Software\;C:\Program Files\WIDCOMM\Bluetooth Software\syswow64;C:\Program Files (x86)\Windows Live\Shared;C:\Program Files\Bruce\jEdit;C:\Program Files (x86)\QuickTime\QTSystem\;c:\Regina;C:\Program Files\TortoiseSVN\bin;;F:\eclipse;;.

After renaming jre directory I get

-vm
C:\Program Files (x86)\Java\jre7\bin\client\jvm.dll
eclipse.home.location=file:/F:/eclipse/
eclipse.launcher=F:\eclipse\eclipse.exe
eclipse.launcher.name=Eclipse
eclipse.p2.data.area=@config.dir/../p2/
eclipse.p2.profile=epp.package.java
eclipse.product=org.eclipse.epp.package.java.product
eclipse.startTime=1365550310914
eclipse.vm=C:\Program Files (x86)\Java\jre7\bin\client\jvm.dll
eclipse.vmargs=-Dosgi.requiredJavaVersion=1.5

这篇关于有没有办法将Java 7安装到USB上,并将其用于eclipse中的项目?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆