공부/Intellij

    [Intellij] import문 자동정리

    [Intellij] import문 자동정리

    intellij 에서 사용하지 않는 import 문이 남아 있는 경우가 있다. 단축키를 사용해서 정리하는 방법 맥 : command + option + o 윈도우 : ctrl + alt + o 단축키를 사용하는 방법은 파일마다 눌러줘야 한다. 이러한 방법은 귀찮으므로... 자동 정리할 수 있게 설정해 두고자 한다. Intellij 설정 Intellij에서 Auto Import 라는걸로 사용하지 않는 import 를 정리할 수 있다. Action 검색> command + shift + A "auto import" 를 검색 후 Optimize imports on the fly 를 체크해준다

    [JPA]No results returned by the Query error in PostgreSQL

    JPA 에서 repository 에서 query 문에 update를 사용하는데 아래 어노테이션이 없으면 다음과 같은 에러가 발생한다. Modifying 어노테이션을 추가해주면 된다. @Modifying 내가 작성한 코드 @Modifying @Query(value = "update schema.dbname set date = to_date(date,'DD Mon YYYY') where site='news' and date not like '%-%'",nativeQuery = true) void updateDate();

    cdn 으로 불러온 js 라이브러리를 인식하지 못하는 경우 - Unresolved function or method $()

    cdn 으로 불러온 js 라이브러리를 인식하지 못하는 경우 - Unresolved function or method $()

    js 를 사용하는데 jquery 를 인식하지 못하는 오류가 생겼다. cdn 위에 마우스를 대고 있으면 창이 뜨는데 download library 를 클릭해서 라이브러리를 다운받아준다 보라색 하이라이터가 생기면서 사용할 수 있다.

    [Thymeleaf] The layout:decorator/data-layout-decorator processor has been deprecated and will be removed in the next major version of the layout dialect.

    [Thymeleaf] The layout:decorator/data-layout-decorator processor has been deprecated and will be removed in the next major version of the layout dialect.

    thymeleaf 에서 다른 폴더를 호출해서 사용하는 decorator 를 사용하는데 생긴 오류였다. 해결방법으로는 layout:decorator 부분을 layout:decorate 로변경해서 사용하면 된다.

    Intellij gradle에서 war 추출하고 외장 톰캣 사용

    Intellij gradle에서 war 추출하고 외장 톰캣 사용

    프로젝트를 war 파일로 만들어서 외부 tomcat 을 사용해 배포해보고자 한다. War 배포하기(1) build.gradle 에 마지막 줄에 적힌 war 를 적어주고 아래 bootWar 부분과 providedRuntime 내용도 적어준다. bootWar{ archiveBaseName = 'proto' //war 패키징 시 이름 설정 archiveFileName = 'proto.war' //war 패키징 시 이름 설정 archiveVersion = '0.0.1-SNAPSHOT' } //내장톰켓 사용 안함 providedRuntime 'org.springframework.boot:spring-boot-starter-tomcat' build 아래에 bootWar이 생긴것을 확인할 수 있다. 아래의 ocnfi..

    [Intellij] Intellij에서 jupyter notebook 연결

    [Intellij] Intellij에서 jupyter notebook 연결

    python 파일은 src와 같은 라인에 만들어 주었다. D:/Users/Intellij/apidemo/python/ Jupyter Server Configure 설정 ipynb있는 파일 에서 Configure jupyter server 를 누르면 Configured Server 에 현재 올라가져있는 주피터 노트북 주소와 토큰까지 복사해서 붙여넣기 하면된다. 현재 올라가져있는 주피터 노트북 확인은 java terninal 창에 다음 명령어로 jupyter 서버가 실행되었는지 확인하면 된다. jupyter notebook list 전체 링크를 configured server 에 복사 붙여넣기 한 후 OK 를 누른다. 주피터 노트북의 환경설정 주피터 노트북의 환경설정 파일 위치를 찾아서 C:\Users\us..

    [Intellij]  python interpreter configure 설정하기 (자바에서 파이썬 실행하기)

    [Intellij] python interpreter configure 설정하기 (자바에서 파이썬 실행하기)

    Java에서 python을 실행시키고자 할 때 python interpreter 를 세팅해주어야 한다. (Intellij Ultimate 사용중) Intellih에 파이썬 파일을 넣고 실행시키려고 하니 no python interpreter configured for the module 의 오류가 노오고 파이썬 실행을 할 수 없었다. 다음 에러를 해결하고 Intellij에서 파이썬을 해결하기 위해서는 python sdk 를 추가하면된다. 프로젝트 상단에 File -> Project Structure -> Platform Settings -> SDKs -> + -> Add Python SDK System Interpreter 에서 python.exe 파일을 선택한다. SDK를 설정하고 자바를 실행시켰을 때..

    Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured.

    Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured.

    spring boot 처음실행 시 다음과 같은 에러가 났다. Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured. application.properties 에 JDBC url 을 추가해준다. [mysql] spring.datasource.driver-class-name=com.mysql.jdbc.Driver spring.datasource.url=jdbc:mysql://localhost:3306/[DB스키마명]?autoReconnect=true spring.datasource.username=[DB접속Id] spring.datasource.password..

    [intellij] db 연결 - intellij에 database연결해서 사용하기

    [intellij] db 연결 - intellij에 database연결해서 사용하기

    intellij 에서 database를 연결해서 사용하고자 한다 오른쪽 탭 3개중에 database선택 후 + 버튼을 눌러 사용하고자 하는 db를 선택해준다 다음 화면에서 연결하고자 하는 db에 해당하는 host, name, password, database를 입력해준다 URL하단에 Test Connection 을 눌러 데이터베이스가 올라갈 수 있도록 한다.

    Intellij 프로젝트 생성

    Intellij 프로젝트 생성

    프로젝트 기본 환경 설정 •gradle •java •war •java 8 •Spring Boot DevTools •Lombok •Spring Web Services •Thymeleaf