반응형

Teminal에서 java -version 명령어를 사용하였을 때 출력되는 자바 버전을 바꿀려면 여러가지 방법이 있지만 한줄로 바로 바꿔주는 명령어을 찾았다.

export JAVA_HOME="`/usr/libexec/java_home -v '1.8*'`"

위 명령어를 터미널에 입력하면 mac에서 실행되는 자바 버전이 1.8버전으로 바뀐다.

단 자바 JDK 버전이 설치가 되어 있어야 한다.

1.7로 바꾸고 싶다면

export JAVA_HOME="`/usr/libexec/java_home -v '1.7*'`"

로 명령어를 사용하면 된다.

java -version 명령어로 확인해보면 바뀐 자바 버전이 보일 것이다.

반응형
반응형

scp는 리룩스에서 사용되는 서버로서버로 파일 복사및 전달하는 명령어이다.

사용법:

1. 원격 서버 -> 로컬 서버

scp -options 계정@원격서버주소:파일경로 전송받을위치

2.로컬 서버 -> 원격서버

scp -options 전송파일위치 계정@원격서버주소:전송받을위치


options:

-P : 포트번호

-p : 파일 권한 유지

-r : 하위 디렉토리 및 파일 모두 복사.


*대문자 P와 소문자 p 옵션이 따로 있으니 주의하고 사용!


ex) a계정으로 b.tistory.com서버 /home/c라는 폴더에 내 컴퓨터 Desktop에 있는 파일 example.txt를 전송할때

scp /Users/username/Desktop/example.txt a@b.tistory.com:/home/c

반응형

'Linux > 명령어' 카테고리의 다른 글

iconv 명령어  (0) 2015.12.29
split 명령어  (0) 2015.12.23
반응형

JAVA에는 L&F(Look & Feel)이라는 것을 이용하여 GUI의 모양을 결정할 수 있다.

L&F를 사용하여 맥에서 window에서 실행되는 JAVA GUI처럼 MAC에서 실행되는 GUI를 바꿀 수 있다.


아래와 같은 코드를 프로그램에 넣으면 MAC에서 실행되는 자바 SWING 프로그램의 GUI를 windows 환경처럼 바꿀 수 있다.

try{

UIManager.setLookAndFeel("javax.swing.plaf.metal.MetalLookAndFeel");

}catch(Exception e){

e.printStackTrace();

}


위 사진은 MAC에서 실행한 예제이다.


위 사진은 L&F를 변경하여 MAC에서 실행한 예제이다.


내가 이 L&F를 사용하게 된 이유는 Mac에서 실행한 자바 프로그램에서 아직 원인은 모르지만 Button의 색을 바꿀때 바뀌지 않는 경우가 발생할 때가 있다.

하지만 windows에서는 같은 프로그램이지만 Button의 색이 잘 변경되어서 이 문제를 해결하기 위해 구글에서 검색하다보니 L&F라는 것을 알게되어 Button색을 바꿔줄 수 있게 되었다.


Sun's JRE에서 제공되는 L&F의 종류

Sun's JRE provides the following L&Fs:

  1. CrossPlatformLookAndFeel—this is the "Java L&F" (also called "Metal") that looks the same on all platforms. It is part of the Java API (javax.swing.plaf.metal) and is the default that will be used if you do nothing in your code to set a different L&F.

  2. SystemLookAndFeel—here, the application uses the L&F that is native to the system it is running on. The System L&F is determined at runtime, where the application asks the system to return the name of the appropriate L&F.

  3. Synth—the basis for creating your own look and feel with an XML file.

  4. Multiplexing— a way to have the UI methods delegate to a number of different look and feel implementations at the same time.

* 참고 사이트

https://docs.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html

반응형

+ Recent posts