Nice programing

경로에 공백이있을 때 Windows 8의 eclipse.ini에서 jdk 경로를 지정하는 방법

nicepro 2020. 12. 13. 11:06
반응형

경로에 공백이있을 때 Windows 8의 eclipse.ini에서 jdk 경로를 지정하는 방법


이것은 작동하지 않습니다 -vm % JAVA_HOME % / bin / javaw.exe

경로에 공백 ( "프로그램 파일"디렉토리)이 포함 된 경우 Windows 8에서 % JAVA_HOME %을 전체 경로로 어떻게 바꿀 수 있습니까?


시도해 보셨습니까? 모든 것을 한 줄에 넣지 마십시오.

-vm
C:\Program Files\Java\jdk1.6.0_07\bin\

javaw 또는 java 실행 파일이 포함 된 폴더를 넣어야합니다. Eclipse 4.7.1이 설치된 Ubuntu 18에서는 다음과 같이 실행할 수있었습니다.

-vm
/usr/lib/jvm/java-8-openjdk-amd64/bin
-startup
plugins/org.eclipse.equinox.launcher_1.4.0.v20161219-1356.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.gtk.linux.x86_64_1.1.500.v20170531-1133
-vmargs
-Xmx2G
-Xms200m
-XX:MaxPermSize=384m

작동하지 않으면 -vmargs에서 이전 위의 줄을 추가했는지 확인하십시오 eclipse.ini.


vm args 위에 vm 항목을 추가하십시오. 그렇지 않으면 작동하지 않습니다 ..! 즉`

    -vm
    C : \ Program Files \ Java \ jdk1.7.0_75 \ bin \ javaw.exe
    --launcher.appendVmargs
    -vmargs
    -Dosgi.requiredJavaVersion = 1.6
    -Xms40m
    -Xmx512m

Mac을 사용하는 경우 다음 단계를 진행하십시오.

  1. 다음 디렉토리로 이동하십시오.

    /sts-bundle/STS.app/Contents/Eclipse
    
  2. STS.ini 파일에 명시 적으로 Java 홈을 추가합니다.

    -vm
    /Library/Java/JavaVirtualMachines/jdk1.8.0_144.jdk/Contents/Home/bin
    -vmargs
    

확인 추가하지 한 줄에있는 모든 문을


나는 같은 문제에 직면했지만 이것을 시도하기 전까지는 해결할 수 없었습니다.

  1. 넣어주세요 -vm
  2. 그런 다음 Enter
  3. 그리고 붙여 넣기 C:\Program Files\Java\jdk1.6.0_07\bin\javaw.exe

tl; dr

상기 상단 당신의 eclipse.ini파일을 추가 -vm하여 JDK의 경로와 옵션 bin 디렉토리 ; 예 :

-vm
C:\Program Files\Java\jdk1.8.0_161\bin\

세부

메모

  • 경로는 -vm옵션 아래 새 줄에 있습니다.
  • 문자를 이스케이프하거나 슬래시를 사용할 필요가 없습니다 (백 슬래시 사용 가능).
  • 경로는 bin디렉토리가 아니라 디렉토리를 가리 킵니다.javaw.exe

Gotcha JAVA_HOME

eclipse.ini파일에 가상 머신을 지정하지 않으면 JAVA_HOME환경 변수가 사용 된다고 생각할 수 있지만 그렇지 않습니다!
에서 FAQ_How_do_I_run_Eclipse # Find_the_JVM

Eclipse는 JAVA_HOME 환경 변수를 참조하지 않습니다.

대신 Windows 검색 경로가 검색됩니다.

권장 사항
검색 경로는 유연하기 때문에 사용하는 것이 좋습니다.
이것은 사실이지만 프로그램을 설치하거나 업데이트하면 검색 경로가 변경 될 수 있다는 단점도 있습니다.
따라서 eclipse.ini파일 에서 명시 적 설정을 사용하는 것이 좋습니다 .

VM 찾기

The reason why you should specify the bin directory and not the javaw.exe (as proposed by many other answers), is that the launcher can then dynamically choose which is the best way to start the JVM. See details of the launcher process for all details:

We look in that directory for: (1) a default.ee file, (2) a java launcher or (3) the jvm shared library.

Verfication

You can verify which VM is used by your running eclipse instance in the Configuration dialogue.
In eclipse Oxygen go to Help - About Eclipse - Installation Details - Configuration

You will see which VM path eclipse has chosen, e.g.:

eclipse.vm=C:\Program Files\Java\jdk1.8.0_161\bin\..\jre\bin\server\jvm.dll

All above answers didn't work for me. My Eclipse mars is x64 but I need to set registry dll to x86 for another software.

At the end I put -vm argument at the end of shortcut and this did the trick.

D:\mars\eclipse\eclipse.exe -vm "C:\Program Files\Java\jre7\bin\server\jvm.dll"

According to this doc jvm.dll also work for some cases.


Even if your %JAVA_HOME% contains spaces, you can directly put entire string over there.

-vm
C:\Program Files (x86)\Java\jdk1.8.0_162\bin

Also, you don't have to specify javaw.exe in the path, just mention it till bin it will find javaw.exe in bin folder by itself. Just keep one thing in mind that the jdk version you provide should match with the eclipse version you are using.

If you are using a 64 bit java then download 64 bit Eclipse. If you are using a 32 bit java then download 32 bit Eclipse.


Solution in:How do I set the eclipse.ini -vm option?

-vm C:\\bin

 -vm
C:\<java_path>\bin

Must be the first thing in eclipse.ini


Windows-vm "C:\Program Files\Java\jdk1.6.0_07\jre\bin\javaw.exe"


I have Windows 8.1 and my JDK under "Program Files" as well. What worked for me was replacing the name of the folder by the 8-digit internal MS-DOS name.

-vm
C:/PROGRA~1/Java/jdk1.8.0_40/bin/javaw.exe

I realized what was going on after running this in cmd.exe

CD \
DIR P* /X

It returned...

<DIR>          PROGRA~1     Program Files
<DIR>          PROGRA~2     Program Files (x86)

So we can find out how to use a path containing spaces


Try to escape the space with back slash.. Like

C:\program\folder\ \name\java\jdk\bin


Go to C drive root in cmd Type dir /x This will list down the directories name with ~.use that instead of Program Files in your jdk path


-vm C:\Program Files\Java\jdk1.6.0_07\bin\javaw.exe


Reinstall java and choose a destination folder without a space

참고URL : https://stackoverflow.com/questions/23174265/how-to-specify-jdk-path-in-eclipse-ini-on-windows-8-when-path-contains-space

반응형