차근차근/이것저것
PMD..적용하기
PMD를 설치해서 코드 검사를 해야 한다고 한다.
기존 방법으로는 플러그인을 설치할 수 없어서.. 수동으로 설치해보려고 한다.(케플러 사용중)
http://acanda.github.io/eclipse-pmd/getting-started.html
Install
Eclipse Marketplace
The recommended way to install the plugin on Eclipse 3.7 (and later) is to drag and drop the following button into a running Eclipse workspace:Update Site
An alternative way to install the plugin on Eclipse 3.7 (and later) is via the plugin update site http://www.acanda.ch/eclipse-pmd/release/latest.
- In Eclipse go to Help > Install new software...
- Add a new installation site and use http://www.acanda.ch/eclipse-pmd/release/latest as the location.
- Select the plugin Eclipse PMD.
- Finish the installation by accepting the license and restarting Eclipse.
Activate
Use the property dialog of your project(s) to activate eclipse-pmd.
- If you don't already have a PMD rule set then create a new one.
- Open the property dialog of your project.
- Select the PMD property page.
- Check the Enable PMD for this project checkbox.
- Add one or more rule sets by clicking the Add... button.
- Close the property dialog. Your project will now be analysed by PMD.
- If you have another project where you want to activate eclipse-pmd, continue with step 2.
사이트 업데이트
Eclipse 3.7 (이상)에서 플러그인을 설치하는 또 다른 방법은 플러그인 업데이트 사이트 http://www.acanda.ch/eclipse-pmd/release/latest를 사용하는 것입니다.
- Eclipse에서 도움말 > 새 소프트웨어 설치 ... 로 이동 하십시오.
- 새 설치 사이트를 추가하고 사용 http://www.acanda.ch/eclipse-pmd/release/latest을 위치로.
- 플러그인 Eclipse PMD를 선택하십시오 .
- 라이센스를 수락하고 Eclipse를 다시 시작하여 설치를 완료하십시오.
활성화
프로젝트의 등록 정보 대화 상자를 사용하여 eclipse-pmd를 활성화하십시오.
2. 이클립스 플러그인 추가 후 새규칙 만들기.
프로젝트 우클릭 후 property 선택 (자바 1.7이상에서 사용가능하다고 한다.)
http://wiki.eclipse.org/Eclipse.ini#Specifying_the_JVM
eclipse.ini
Contents
[hide]Overview
Eclipse startup is controlled by the options in $ECLIPSE_HOME/eclipse.ini
. If $ECLIPSE_HOME
is not defined, the default eclipse.ini
in your Eclipse installation directory (or in the case of Mac, the Eclipse.app/Contents/MacOS
directory) is used.
eclipse.ini
is a text file containing command-line options that are added to the command line used when Eclipse is started up. There are many options available, please see here.
Important:
- You can, and should, experiment with changes to the launch command from your Command Prompt/Terminal before changing the
eclipse.ini
itself. - Each option and each argument to an option must be on its own line.
- All lines after
-vmargs
are passed as arguments to the JVM, so all arguments and options for eclipse must be specified before-vmargs
(just like when you use arguments on the command-line) - Any use of
-vmargs
on the command-line replaces all-vmargs
settings in the .ini file unless--launcher.appendVmargs
is specified either in the .ini file or on the command-line. (doc) - -XX VM arguments are subject to change without notice, even during minor updates. If the JVM keeps exiting with code 2 instead of starting Eclipse, try removing them.
- Make a backup--keep a copy of the original contents on hand so you don't break your installation and have to download it all again.
By default, eclipse.ini
looks something like this (the exact contents will vary based on operating system and which Eclipse package you have):
-startup
../../../plugins/org.eclipse.equinox.launcher_1.2.0.v20110502.jar
--launcher.library
../../../plugins/org.eclipse.equinox.launcher.cocoa.macosx.x86_64_1.1.100.v20110502
-product
org.eclipse.epp.package.jee.product
--launcher.defaultAction
openFile
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
256m
--launcher.defaultAction
openFile
-vmargs
-Dosgi.requiredJavaVersion=1.5
-XX:MaxPermSize=256m
-Xms40m
-Xmx512m
Among other things, this sets the heap space to 40MB initially and a maximum of 512MB, and also specifies a maximum PermGen size of 256MB. A max heap of 512MB might be OK for some users, but it's often necessary to bump that value up for large project sets or when some third-party plugins are installed.
Specifying the JVM
One of the most recommended options to use is to specify a specific JVM for Eclipse to run on. Doing this ensures that you are absolutely certain which JVM Eclipse will run in and insulates you from system changes that can alter the "default" JVM for your system. Many a user has been tripped up because they thought they knew what JVM would be used by default, but they thought wrong. eclipse.ini lets you be CERTAIN.
The following examples of eclipse.ini
demonstrate correct usage of the -vm option.
Note the format of the -vm
option - it is important to be exact:
- The
-vm
option and its value (the path) must be on separate lines. - The value must be the full absolute or relative path to the Java executable, not just to the Java home directory.
- The
-vm
option must occur after the other Eclipse-specific options (such as-product
,--launcher.*
, etc), but before the-vmargs
option, since everything after-vmargs
is passed directly to the JVM. - For the 32-bit Eclipse executable (eclipse.exe on Windows) a 32-bit JVM must be used and for the 64-bit Eclipse executable a 64-bit JVM must be used. 32-bit Eclipse will not work with a 64-bit JVM.
Here is an example of what eclipse.ini
might look like on a Windows system after you've added the -vm
argument and increased the maximum heap space:
-startup
plugins/org.eclipse.equinox.launcher_1.2.0.v20110502.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_1.1.100.v20110502
-product
org.eclipse.epp.package.java.product
--launcher.defaultAction
openFile
--launcher.XXMaxPermSize
256M
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
256m
--launcher.defaultAction
openFile
-vm
C:\Java\JDK\1.8\bin\javaw.exe
-vmargs
-Dosgi.requiredJavaVersion=1.5
-Xms40m
-Xmx1024m
Remember that the exact values will differ slightly depending on operating system and Eclipse package.
-vm value: Windows Example
This is how the -vm
argument might look on Windows (your exact path to javaw.exe
could be different, of course. Please beware of paths that contain a space, the examples below do not have any spaces, and using quotation marks around paths that contain spaces does not seem to work):
-vm
C:\jdk1.7.0_21\bin\javaw.exe
Or
-vm
C:\progra~1\Java\jre1.8.0_112\bin\javaw.exe
An alternative way is to insert the following VM option before the -vmargs option in the Eclipse shortcut's properties (edit the field Target inside the "Shortcut" tab):
-vm C:\jdk1.7.0_21\bin\javaw.exe
or
-vm C:\jdk1.7.0_21\jre\bin\java.exe
This might not work on all systems. If you encounter "Java was started but returned exit code=1" error while starting the eclipse, modify the -vm
argument to point to jvm.dll
(exact path could be different):
-vm
C:\Development\Java\64bit\jdk1.7.0_09\jre\bin\server\jvm.dll
-vm value: Linux Example
This is how the -vm argument might look on Linux (your exact path to java
could be different, of course):
-vm
/opt/sun-jdk-1.6.0.02/bin/java
-vm value: Mac OS X Example
On a Mac OS X system, you can find eclipse.ini
by right-clicking (or Ctrl+click) on the Eclipse executable in Finder, choose Show Package Contents, and then locate eclipse.ini
in the Eclipse
folder under Contents
. The path is often
/Applications/Eclipse.app/Contents/Eclipse/eclipse.ini
For versions of Mac OS X 10.7+ the location is something like /Library/Java/JavaVirtualMachines/<JRE_NAME>/Contents/Home/bin
For example, the latest JDK 1.8 (as of July 2015) is /Library/Java/JavaVirtualMachines/jdk1.8.0_51.jdk/Contents/Home/bin
For standard Mac Java installations and so you don't have to continually update the setting when you install new Java VMs, set the -vm
flag to simply /usr/bin
:
-vm
/usr/bin
Here is additional information:
Perhaps the best way to determine the location for the JDK you want to use is with the utility
/usr/libexec/java_home --verbose
From the list produced by that command, select the JDK you want to use and put that path into the eclipse.ini file, making sure to append /bin/java
to the path (eg, /Library/Java/JavaVirtualMachines/jdk1.7.0_71.jdk/Contents/Home/bin/java
Note that the full path can either include java
or not. For example, the following will both work:
-vm
/Library/Java/JavaVirtualMachines/jdk1.8.0_51.jdk/Contents/Home/bin
-vm
/Library/Java/JavaVirtualMachines/jdk1.8.0_51.jdk/Contents/Home/bin/java
음.. 프로젝트를 1.7로 변경해서 진행할 것인가...다른 것을 찾아볼 것인가..
'차근차근 > 이것저것' 카테고리의 다른 글
"frameset","viewport","iphone" (1) (0) | 2017.09.27 |
---|---|
홈페이지 점검 후 수정하기 1 (0) | 2017.05.19 |
네이버 지도 api v3 사용하기 (0) | 2017.03.16 |
아파치톰캣 오라클 연동 (0) | 2017.03.14 |
centOS sendmail에서 gmail로 발송이 안됨. 11 - gmail을 통해서 전송 (2) | 2017.01.19 |
'차근차근/이것저것'의 다른글
- 현재글PMD..적용하기