본문 바로가기

IT/IDE

[IDE] Netbeans 11.3 Install and Setting (Apache Tomcat)

1. Netbeans 란?

Netbeans는 선 마이크로 시스템즈에서 개발하였고, 현재는 오라클에서 후원하고 있는 오픈소스 IDE 프로젝트입니다.
Java, C, C++, PHP등의 다양한 언어를 위한 통합 개발 환경을 제공합니다.

Windows 10에서 Netbeans 설치를 진행하였고, 웹 서버 개발환경에 초점을 맞추었습니다.

2. Netbeans 다운로드

https://netbeans.apache.org/download/nb113/nb113.html

 

Downloading Apache NetBeans 11.3

Apache NetBeans 11.3 runs on the JDK LTS releases 8 and 11, as well as on JDK 14, i.e., the current JDK release at the time of this NetBeans release.

netbeans.apache.org

위 링크로 이동해서, OS에 맞는 Installer를 설치해줍니다.
저는 Windows 10 x64을 사용하고 있어서 Apache-NetBeans-11.3-bin-windows-x64.exe를 설치했습니다.

3. JDK 설치

2020/04/07 - [IT/JAVA] - [Java] Windows 10 Open-JDK 8 다운로드 및 환경변수 설정

작업하는 용도에 맞는 JDK를 설치하면 됩니다.

4. Netbeans 설치

다운받은 Apache-NetBeans-11.3-bin-windows-x64.exe를 실행시키면 Java EE, HTML5/Javascript, PHP 등 여러가지 통합 개발 환경을 지원하는데, 필요한 개발환경만 설치해주시면 됩니다. 특별한 설정 없이 Next 버튼을 누르면 설치가 완료됩니다.

5. Netbeans UTF-8 설정

C:\Program Files\NetBeans-11.3\netbeans\etc\netbeans.conf

netbeans 설정파일을 열어줍니다. netbeans 설정 파일은 설치경로에 따라서 달라질 수 있습니다.

설정파일을 보면 netbeans_default_options="설정 값..." 옵션을 볼 수 있습니다. 해당 옵션 끝에 밑에 명시된 옵션을 추가해줍니다.

-J-Dfile.encoding=UTF-8

ex

JDK 버전을 변경할 경우 jdk 설치 후 netbeans.conf 파일의 default-jdk 경로를 수정하시면 됩니다.
혹은 각 프로젝트 마다 사용하는 jdk를 변경할 수 있습니다.

6. Tomcat 설치

Netbeans 11은 Tomcat을 직접 설치해주어야 합니다.  사용하고 싶은 Tomcat 버전을 다운로드해줍니다.

저는 Tomcat 8을 설치하도록 하겠습니다.

https://tomcat.apache.org/download-80.cgi

 

Apache Tomcat® - Apache Tomcat 8 Software Downloads

Welcome to the Apache Tomcat® 8.x software download page. This page provides download links for obtaining the latest versions of Tomcat 8.x software, as well as links to the archives of older releases. Unsure which version you need? Specification versions

tomcat.apache.org

7. Tomcat Manager 설정

Tomcat Install Path\conf\tomcat-users.xml을 열어줍니다.

<?xml version="1.0" encoding="UTF-8"?>

...
  <role rolename="manager-gui"/>
  <role rolename="manager-script"/>
  <role rolename="tomcat"/>
  <role rolename="role1"/>
  <user username="tomcat" password="" roles="tomcat"/>
  <user username="both" password="" roles="tomcat,role1"/>
  <user username="role1" password="" roles="role1"/>
<!-- Tomcat Manager Setting -->
  <user username="bamdule" password="1234" roles="manager-script,admin,manager-gui"/>
  

...

  위와 같이 설정한 다음 저장 후 창을 닫아줍니다.

8. Netbeans 11 실행 

netbeans 11을 실행하면 오른쪽 아래에 에러 툴팁이 노출될 수 있는데, nb-javac-editor 에러일 경우 install을 눌러 nb-javac-editor를 설치해주세요. 
JDK 경로 확인

프로젝트 우 클릭 > Properties > Build > compile > Manage Java Platforms > Platform Folder 확인

9. Apache Tomcat 연동

Tools > Servers > Add Server > Apache Tomcat or TomEE > Server Location 입력 (ex : D:\apache\apache-tomcat-8.5.43) >  Username과 Password의 Tomcat Manager 정보를 입력한다. > Finish

10. Apache Tomcat 실행

실행이 완료되면 Web Applications 리스트를 확인할 수 있습니다.

이 후에는 작업했던 프로젝트 또는 새로운 프로젝트를 생성하여 테스트하면 됩니다.