'OS > Linux' 카테고리의 다른 글
X매니저 사용법 (0) | 2017.12.28 |
---|---|
SVN(subversion) 설치방법 ~ eclipse를 통한 접속테스트 방법 (0) | 2017.12.14 |
os별 libarary path 설정 (0) | 2017.11.16 |
리눅스 명령어 (0) | 2017.11.10 |
리눅스 자바 버전 변경하기 (0) | 2017.11.10 |
X매니저 사용법 (0) | 2017.12.28 |
---|---|
SVN(subversion) 설치방법 ~ eclipse를 통한 접속테스트 방법 (0) | 2017.12.14 |
os별 libarary path 설정 (0) | 2017.11.16 |
리눅스 명령어 (0) | 2017.11.10 |
리눅스 자바 버전 변경하기 (0) | 2017.11.10 |
[LINUX] CentOS 부팅시 오류 : UNEXPECTED INCONSISTENCY; RUN fsck MANUALLY (0) | 2017.12.28 |
---|---|
SVN(subversion) 설치방법 ~ eclipse를 통한 접속테스트 방법 (0) | 2017.12.14 |
os별 libarary path 설정 (0) | 2017.11.16 |
리눅스 명령어 (0) | 2017.11.10 |
리눅스 자바 버전 변경하기 (0) | 2017.11.10 |
### This file controls the configuration of the svnserve daemon, if you ### use it to allow access to this repository. (If you only allow ### access through http: and/or file: URLs, then this file is ### irrelevant.) [general] ### These options control access to the repository for unauthenticated ### and authenticated users. Valid values are "write", "read", ### and "none". The sample settings below are the defaults. anon-access = read --익명 사용자 읽기 여부 auth-access = write --인증 사용자 쓰기 여부 ### The password-db option controls the location of the password ### database file. Unless you specify a path starting with a /, ### the file's location is relative to the directory containing ### this configuration file. ### If SASL is enabled (see below), this file will NOT be used. ### Uncomment the line below to use the default password file. password-db = passwd --실행 시 계정 목록 불러오기 ### The authz-db option controls the location of the authorization ### rules for path-based access control. Unless you specify a path ### starting with a /, the file's location is relative to the the ### directory containing this file. If you don't specify an ### authz-db, no path-based access control is done. ### Uncomment the line below to use the default authorization file. authz-db = authz --실행 시 계정 권한 체크 ### This option specifies the authentication realm of the repository. ### If two repositories have the same authentication realm, they should ### have the same password database, and vice versa. The default realm ### is repository's uuid. ### realm = MW First Repository [sasl] ### This option specifies whether you want to use the Cyrus SASL ### library for authentication. Default is false. ### This section will be ignored if svnserve is not built with Cyrus |
### This file is an example password file for svnserve. ### Its format is similar to that of svnserve.conf. As shown in the ### example below it contains one section labelled [users]. ### The name and password for each user follow, one account per line. [users] # harry = harryssecret # sally = sallyssecret mkgil = mkgil0415 -- 아이디=패스워드 |
### This file is an example authorization file for svnserve. ### Its format is identical to that of mod_authz_svn authorization ### files. ### As shown below each section defines authorizations for the path and ### (optional) repository specified by the section name. ### The authorizations follow. An authorization line can refer to: ### - a single user, ### - a group of users defined in a special [groups] section, ### - an alias defined in a special [aliases] section, ### - all authenticated users, using the '$authenticated' token, ### - only anonymous users, using the '$anonymous' token, ### - anyone, using the '*' wildcard. ### ### A match can be inverted by prefixing the rule with '~'. Rules can ### grant read ('r') access, read-write ('rw') access, or no access ### (''). [aliases] # joe = /C=XZ/ST=Dessert/L=Snake City/O=Snake Oil, Ltd./OU=Research Institute/CN=Joe Average [groups] # harry_and_sally = harry,sally # harry_sally_and_joe = harry,sally,&joe # [/foo/bar] # harry = rw # &joe = r # * = # [repository:/baz/fuz] # @harry_and_sally = rw # * = r [/] mkgil=rw *=r |
1. Simple Mode에서 Advanced Mode 선택 2. Use specified name을 선택해서 프로젝트 이름을 입력 · SVN상에 표기할 프로젝트 이름 3. Project Repository Layout의 Use multiple projects layout with the specified root name을 선택 · 최상위 SVN 저장소에서 구분을 해주는(폴더처럼) 이름을 넣어 준다. 4. 마지막으로 Use Subversion recommanded layout('trunk', 'branches' and 'tags')를 선택한다. · 이 부분을 선택해야지만 멀티 프로젝트별로 trunk / branches / tags를 관리 할수 있다. |
[LINUX] CentOS 부팅시 오류 : UNEXPECTED INCONSISTENCY; RUN fsck MANUALLY (0) | 2017.12.28 |
---|---|
X매니저 사용법 (0) | 2017.12.28 |
os별 libarary path 설정 (0) | 2017.11.16 |
리눅스 명령어 (0) | 2017.11.10 |
리눅스 자바 버전 변경하기 (0) | 2017.11.10 |
aix
export LIBPATH=패스:$LIBPATH |
hp-ux
export SHLIB_PATH=패스:$SHLIB_PATH |
hp-ux ia64
export LD_LIBRARY_PATH=패스:$LD_LIBRARY_PATH |
linux
export LD_LIBRARY_PATH=패스:$LD_LIBRARY_PATH |
solaris
export LD_LIBRARY_PATH=패스:$LD_LIBRARY_PATH |
Table 1. Names of the library path environment variable, by operating system
|
출처: http://extremeblue.tistory.com/15 [extremeblue's blues]
X매니저 사용법 (0) | 2017.12.28 |
---|---|
SVN(subversion) 설치방법 ~ eclipse를 통한 접속테스트 방법 (0) | 2017.12.14 |
리눅스 명령어 (0) | 2017.11.10 |
리눅스 자바 버전 변경하기 (0) | 2017.11.10 |
리눅스에서 java 컴파일 및 실행 하기 (0) | 2016.12.29 |
1) jar -xvf 압축파일
2) java -jar 실행시킬파일명.jar
3) chmod
chmod -R 777 /bin/su
SVN(subversion) 설치방법 ~ eclipse를 통한 접속테스트 방법 (0) | 2017.12.14 |
---|---|
os별 libarary path 설정 (0) | 2017.11.16 |
리눅스 자바 버전 변경하기 (0) | 2017.11.10 |
리눅스에서 java 컴파일 및 실행 하기 (0) | 2016.12.29 |
LINUX BIN 설치방법 (0) | 2016.12.27 |
os별 libarary path 설정 (0) | 2017.11.16 |
---|---|
리눅스 명령어 (0) | 2017.11.10 |
리눅스에서 java 컴파일 및 실행 하기 (0) | 2016.12.29 |
LINUX BIN 설치방법 (0) | 2016.12.27 |
리눅스 tail 명령어 [실시간으로 로그 보기] (0) | 2016.12.16 |
상용 서비스가 되고 있는 상태에서 고객의 요구 사항으로 인하여 자바 데몬 형식의 프로그램을 개발해야 할 때가 있다.
이런 프로그램들은 대게 상용 리눅스 장비에 class 파일을 올린 후 java 명령어를 통해 프로그램을 실행하게 되는데 이것이 생각보다 어렵다.
예전에도 class 파일을 실행하기 위해 몇 번 삽질을 했었는데 어김없이 또 삽질을 하게 되었다.
사실 자바를 처음할 때 배우는 것들인데 이런 삽질을 하는 내 모습을 보면 쪽팔리기도 하다.
그래서 이참에 확실하게 정리를 하고자 한다.
두 가지 방법에 대해서 설명을 할 것이다.
첫 번째는 "패키지 선언되어 있는 java 파일 컴파일 후 실행하기"
두 번째는 "외부 jar 파일을 classpath에 추가한 후 컴파일하고 실행하기"
첫 번째의 경우는 JDK에서 기본적으로 제공하는 API인 src.zip(rt.jar)만을 사용하기 때문에 그닥 사용할 일이 별로 없지만 기본적인 사항이니 일단은 정리한다. (src.zip은 java 파일이 있고, rt.jar는 class파일이 존재)
1. 패키지 선언되어 있는 java 파일 컴파일 후 실행하기
package packagetest;
public class HelloWorld {
public static void main(String[] args) {
System.out.println("Hello World!");
}
}
2. 외부 jar 파일을 classpath에 추가한 후 컴파일하고 실행하기
package packagetest.json;
import java.io.IOException;
import org.codehaus.jackson.JsonGenerationException;
import org.codehaus.jackson.map.JsonMappingException;
import org.codehaus.jackson.map.ObjectMapper;
public class HelloWorldJson {
public static void main(String[] args) throws JsonGenerationException, JsonMappingException, IOException {
System.out.println("Hello World!");
ObjectMapper mapper = new ObjectMapper();
String jsonData = mapper.writeValueAsString("kyuTest");
System.out.println(jsonData);
}
}
여기까지 두 가지 방법에 대해서 알아봤다.
헌데 classpath가 뭔지 그리고 점(.) 또는 콜론(:) 과 같은 기호는 어떤 의미를 부여하는 지에 대해서 알아보자.
자바 런타임으로 class 파일을 실행하고자 할 때에는 class 파일을 찾을 수 있어야 한다.
그래서 class 파일을 찾을 때 classpath에 지정된 경로를 사용한다. 이때 classpath로 지정 가능한 유형은 다음과 같이 세 가지가 있다.
디렉토리 유형 : /home/kyu/test/java/classes
zip 파일 유형 : utils.zip
jar 파일 유형 : utils.jar
java -h 명령어를 통해서도 classpath 유형을 확인할 수 있다.
이렇게 classpath로 세 가지 유형을 제공하고, 디렉토리 또는 jar 파일을 classpath로 지정해야 할 필요가 있다면 콜론(:) 을 이용하여 패스들을 연결할 수 있다.
/home/kyu/test/java/classes:utils.zip:utils.jar
마지막으로 점(.)의 의미는 현재 디렉토리를 classpath로 지정하겠다는 의미이다.
결론
classpath | 자바 런타임이 class 파일을 찾을 때 사용하는 경로 |
콜론(:) | 클래스 패스들을 연결할 때 사용 |
점(.) | java 명령어를 실행하는 디렉토리를 classpath로 지정하겠다는 의미 |
리눅스 명령어 (0) | 2017.11.10 |
---|---|
리눅스 자바 버전 변경하기 (0) | 2017.11.10 |
LINUX BIN 설치방법 (0) | 2016.12.27 |
리눅스 tail 명령어 [실시간으로 로그 보기] (0) | 2016.12.16 |
Fedora 부팅시 repair filesystem 오류 (0) | 2016.12.07 |
리눅스 상에서 확장자 .Bin 설치프로그램을 실행하는 방법
chmod +x 파일명.bin
./파일명.bin
처리하면 된다.
다운로드 받은 .Bin 파일은 실행속성이 없기 때문에 바로 실행할 수 없고,
실행가능 속성(+x)를 부여해줌으로써 실행할 수 있게 된다.
우분투의 경우에는 프로그램 설치를 위해 관리자 권한 획득도 필요하다.
ex) 우분투 실행 예
chmod +x 파일명.bin
sudo ./파일명.bin
리눅스 명령어 (0) | 2017.11.10 |
---|---|
리눅스 자바 버전 변경하기 (0) | 2017.11.10 |
리눅스에서 java 컴파일 및 실행 하기 (0) | 2016.12.29 |
리눅스 tail 명령어 [실시간으로 로그 보기] (0) | 2016.12.16 |
Fedora 부팅시 repair filesystem 오류 (0) | 2016.12.07 |
리눅스오류나 파일의 로그를 보고 싶을 때 tail 명령어를 사용하여 실시간으로 확인한다.
[TAIL 기능]
파일의 마지막 부분을 출력한다.
[문법]
tail [option] ... [file] ...
기본 출력은 파일의 마지막 10줄을 보여준다.
[옵션]
f : 파일의 마지막 10라인을 실시간으로 계속해서 출력
F : 파일 변동 시 실시간으로 보여주되 로그파일처럼 특정 시간이 지난 후 파일이 변하게 되면 새로운 파일을 오픈하여 보여줌
(다시 명령을 실행할 필요가 없음)
n : n 만큼의 라인을 출력
n+n : 마지막 줄이 아니라 첫번째 줄부터 시작해 n 번째 라인 이후부터 출력
--byte=n : n바이트 만큼의 내용을 출력
※ n은 숫자 ※
[예제]
1 | [root@ls ] # tail -n 20 anaconda-ks.cfg |
anaconda-ks.cfg 파일의 마지막부터 20줄까지를 출력한다.
1 | [root@ls ] # tail -n +20 anaconda-ks.cfg |
anaconda-ks.cfg 파일의 20번째 줄 이후를 출력한다.
1 | [root@ls ] # tail -f /var/log/messages |
/var/log/messages 파일을 실시간으로 화면에 출력한다(log 모니터링에 사용됨)
리눅스 명령어 (0) | 2017.11.10 |
---|---|
리눅스 자바 버전 변경하기 (0) | 2017.11.10 |
리눅스에서 java 컴파일 및 실행 하기 (0) | 2016.12.29 |
LINUX BIN 설치방법 (0) | 2016.12.27 |
Fedora 부팅시 repair filesystem 오류 (0) | 2016.12.07 |