1,. 조사 배경
Eclipse를 Ant로 빌드를 하는데 한글이 깨짐
2. 조치
'[IT] Eclipse' 카테고리의 다른 글
[Elicpse] 7 Tips to Speed Up Eclipse (0) | 2017.12.15 |
---|---|
[Eclipse] PyDev Plunin 설치 후, Project 생성시 오류 (0) | 2017.10.31 |
[Eclipse] 윈도우7 에서 이클립스 한글폰트가 작게 보이는 문제 (0) | 2017.08.09 |
1,. 조사 배경
Eclipse를 Ant로 빌드를 하는데 한글이 깨짐
2. 조치
[Elicpse] 7 Tips to Speed Up Eclipse (0) | 2017.12.15 |
---|---|
[Eclipse] PyDev Plunin 설치 후, Project 생성시 오류 (0) | 2017.10.31 |
[Eclipse] 윈도우7 에서 이클립스 한글폰트가 작게 보이는 문제 (0) | 2017.08.09 |
About a month ago, I blogged about my love/hate relationship with Eclipse. I was asked by a few people to share my tips on how I was able to speed it up so here we go… As a side note, this article is not about comparing IDEs, please refrain from displaying your hate for the IDE or your preference for another… This post is just about optimizations that help Eclipse run faster for those who use it. I’ve described each tip for Windows, Linux and MacOS users. Once you have gone through all the optimization tips, Eclipse should start within 10 seconds and run much smoother than before.
[edit]: most of those tips will speed up your Eclipse experience, not just the startup time. Classes will open faster, jumping from one definition to another will be faster. Viewing method javadocs will be faster… Unfortunately, none of that can be timed precisely so there is no specific benchmark about the actual speed gains for each tip.
Note: I assume that you already have an SSD and at least 8Gb of RAM. If not, look no further for performance boosts…
More often than not, every new JDK and Eclipse version includes fixes and optimizations from previous versions. Make sure that you are using the 64 bitsversion of Eclipse and of the Oracle JDK. For any web development, you will want to use Eclipse for Java EE and not Eclipse for Java.
Oracle JDK : http://www.oracle.com/technetwork/java/javase/downloads
Eclipse : https://eclipse.org/downloads/
Place Eclipse and your code on your SSD.
Time to launch Eclipse.
I personally turn off autosuggestions so that they don’t slow down my typing. Instead, I manually trigger the auto suggestions using Ctrl+Space when needed. This is done through:
A RAM disk is a virtual disk or hard drive that is stored into the computer’s memory. It boosts the I/O performance on anything that is on it. Creating a RAM disk uses your RAM even though it just appears as a drive on the computer. Because the memory used will be reserved for the disk and become unavailable for other programs, we will only be putting the JDK on there. 300MB will be enough.
Warning: Don’t put anything permanent on the RAM Disk we will create as it will be erased/recreated at each reboot.
Everything is described here already
The RAM Disk is created with the diskutil tool:
1. Create a new batch file, for example: ~/tools/batch/ramdisk.sh
Replace x, y, and z with the JDK version you have installed on disk:
#!/bin/bash diskutil erasevolume HFS+ 'JDK RAMDISK' `hdiutil attach -nomount ram://614400` cp -r /Library/Java/JavaVirtualMachines/jdk1.x.y_z.jdk /Volumes/JDKRAMDISK
(Note that diskutil expects the number of 512 bytes sectors to be allocated: for 300MB, 300 * 1024 ^ 2 / 512 = 614400)
2. Save your file and make it executable:
chmod 755 ~/tools/batch/ramdisk.sh
Now run ramdisk.sh to create the Ram Disk:
$ ramdisk.sh
Started erase on disk4
Unmounting disk
Erasing
Initialized /dev/rdisk4 as a 300 MB case-insensitive HFS Plus volume
Mounting disk
Finished erase on disk4 JDKRAMDISK
You should now see in Finder the new device called JDKRAMDISK containing your JDK. You can remove the RAM Disk and free its memory by clicking on the Eject button:
Note that if you follow this tip, you will always need to have the RAM Disk in order to launch Eclipse (otherwise you will see the error “A Java Runtime … must be available in order to run Eclipse”). You can configure your system to run the ramdisk.sh script automatically upon startup using Automator or using a launchtl daemon.
1. Download and install the utility called imdisk
2. Create a new batch file, for example: C:/tools/batch/ramdisk.bat
Replace x, y, and z with the JDK version you have installed on disk:
@echo Placing JDK on Virtual Disk N:/ @echo off sc config imdisk start= auto net start imdisk imdisk -a -t vm -s 300m -m n: format n: /q /Y call xcopy C:\<path_jdk>\jdk1.x.y_z N:\jdk1.x.y_z\ /S /E /Y /Q label n: JDK RAMDISK
By running ramdisk.bat, you will have created a new disk N: labeled “JDK RAMDISK” that will contain your JDK.
3. Make sure the file is run as an Administrator. Right click on the file, go into Properties and check Run as Administrator.
Note that if you follow this tip, you will always need to have the RAM Disk in order to launch Eclipse (otherwise you will see the error “A Java Runtime … must be available in order to run Eclipse”). You can configure your system to run the ramdisk.bat script automatically by placing the script into your Startup folder.
In order for Tip 3 to work, you will need to add the -vm setting in eclipse.ini (see next section)
This is one of the most confusing areas of Eclipse optimizations. There are thousands of online articles preaching different configurations… I’ll just describe the way I tweaked my options and add more to the existing confusion
Location your eclipse.ini file:
Windows/Linux: located in $ECLIPSE_HOME
MacOS: located in $ECLIPSE_HOME/Eclipse.app/Contents/MacOS
Eclipse.ini contains 2 types of properties: properties relative to the Eclipse application and properties relative to the JVM. Those options are different depending upon your version of JDK or Eclipse. Here is the most up-to-date list I was able to find online.
To understand those options require just a bit of vocabulary on Oracle’s JVM. Basically, the JVM memory is divided into multiple memory pools where objects reside with time:
In case you are interested, Oracle wrote a great article about garbage collection tuning, detailing all those spaces and roles
The sizes for all those memory pools can be tweaked in eclipse.ini. I have 16Gb of RAM, but these settings will work fine with 8Gb of RAM.
use the JDK stored on the RAM Disk (use the version according to what you did in Step 3):
-vm /Volumes/JDKRAMDISK/jdk1.x.y_z.jdk/Contents/Home/
-vm N:/jdk1.x.y_z/bin
disable bytecode verification (risky)
-Xverify:none
This basically skips the verification of class files (described in http://docs.oracle.com/javase/specs/jvms/se7/html/jvms-4.html#jvms-4.10), meaning that the JVM won’t be able to detect the authenticity of the class files you are using. This poses a security threat if the compiled files have been altered. Use at your own risk. (I use that option for hobby projects but not at work)
turn on performance compiler optimizations
-XX:+AggressiveOpts
increase permanent generation space (where new objects are allocated)
-XX:PermSize=512m
-XX:MaxPermSize=512m
increase min and max heap sizes (which includes young and tenured generations)
-Xms2048m
-Xmx2048m
increase heap size for the young generation
-Xmn512m
set stack size for each thread
-Xss2m
tweak garbage collection
-XX:+UseParallelOldGC
And finally, here are some other options that you may see online… Personally I didn’t notice much of a boost by using any of them so I’m just stating them for info. You can look at the doc reference to know what they correspond to and then play with them:
-XX:MaxGCPauseMillis=10 -XX:+UseG1GC -XX:CompileThreshold=5 -XX:MaxGCPauseMillis=10 -XX:MaxHeapFreeRatio=70 -XX:+CMSIncrementalPacing -XX:+UseFastAccessorMethods -server
Finally, remove all the duplicates as well as launcher.XXMaxPermSize which is useless with the option XX:MaxPermSize.
If you have an anti-virus, make sure that it doesn’t interfere with your code folders. Add the JDK folder, the Eclipse folder, your .m2/jar repositories, and your code folders to the antivirus whitelist.
This is really a matter of personal preference. Some will like the Eclipse integration with the collaborative team tools. Personnally I find them slow, I’d rather have Eclipse concentrate on the dev task than try to do too many things at once… I’m also a sucker for the SVN/GIT CLIs… Anyways, I removed the integration with Eclipse and found it much more responsive.
One of the perks of Eclipse is the trumendous amount of keyboard shortcuts it offers. You can remap them if you are used to other schemes. I usually remap my debugging keys for ex. so that they match the ones in VIsual Studio & Chrome Dev Env. Take some time to learn them. The less your hands leave your keyboard, the faster your Eclipse experience will be!
I won’t go into details about which shortcuts to know but you can easily find that information online. Just thinking about it, a few must-know shortcuts come to mind:
Ctrl+Shift+R : jump to resource
Ctrl+Shift+T : jump to class
Ctrl+. : jump to next error
Ctrl+Shift+G : search for references
Ctrl+Shift+P : select matching bracket
Alt+Arrows : go forward / backwards
Ctrl+Space : autocomplete
Ctrl+Shift+F : format source
Ctrl+Shift+O : organize imports
Ctrl+D : delete line
etc.
This pretty much wraps it up! Without comparing Eclipse to any other tool out there, I find that it can be a very powerful and fast tool to write java code with.
If you have any other tips, I’d love to hear about them!
[Ant] Eclipse 한글 깨짐 현상 제거 (0) | 2018.07.13 |
---|---|
[Eclipse] PyDev Plunin 설치 후, Project 생성시 오류 (0) | 2017.10.31 |
[Eclipse] 윈도우7 에서 이클립스 한글폰트가 작게 보이는 문제 (0) | 2017.08.09 |
Windows > Preference > PyDev 를 가시면 요 그림이 나와야 합니다.
[Ant] Eclipse 한글 깨짐 현상 제거 (0) | 2018.07.13 |
---|---|
[Elicpse] 7 Tips to Speed Up Eclipse (0) | 2017.12.15 |
[Eclipse] 윈도우7 에서 이클립스 한글폰트가 작게 보이는 문제 (0) | 2017.08.09 |
윈도우7 에서 이클립스로 개발을 하려고 새로 설치해보면
영문폰트에 비해 한글이 너무 작게 표시되는 것을 볼 수 있다.
글? 저게 무슨문자인지도 잘 인지가 안된다.
그래서 글을 좀 써보았다...
영문폰트 대비 한글폰트가 너무 작아서 읽기가 쉽지 않다.
이부분은 아주 오래전(?) 부터 생겨났다.
Eclipse Helios (3.6)부터였는지... Eclipse Indigo (3.7) 부터였는지... 기억도 안난다.
사실 오래된 버그인만큼 많은 사람들이 느끼고 다음에는 수정되려니 했지만...
Juno가 등장한 지금도 수정이 안되어 이렇게 간단한 해결책을 적어본다.
우선 설정으로 들어간다.
General > Appearance > Colors and Forts 에 보면
Basic 에 Text Font부분이 있다.
기복적으로 Consolas 10으로 되어 있다.
이 폰트 사이즈를 9로 수정하면 아래와 같이 수정된 모습을 볼 수 있다.
글꼴을 작게 했는데 막상 한글이 더 커지는 재미있는 모습을 확인 할 수 있다. ㅎㅎ
음 버그리포트를 해야 할까나?
사실 처음 설치할때 한번만 접하면 되는 문제여서 아직 수정이 안되고 있는지도 모르겠다.
글꼴이 이상하게 보이시던 분들은 참고하시길. ^^*
# 참고
http://millky.com/@origoni/post/759?language=ko_kr
[Ant] Eclipse 한글 깨짐 현상 제거 (0) | 2018.07.13 |
---|---|
[Elicpse] 7 Tips to Speed Up Eclipse (0) | 2017.12.15 |
[Eclipse] PyDev Plunin 설치 후, Project 생성시 오류 (0) | 2017.10.31 |