2017-01-06 8 views
0

eclipse에서 runnable jar 파일로 올바르게 내보내지지 않는 javafx 응용 프로그램이 있습니다. 내보낼 때 .jar 파일이 제대로 실행되지 않고 GUI가 나타나지 않습니다. 아래는 Manifest 파일입니다. enter image description here내 보낸 Javafx 응용 프로그램이 Jar 파일 (Eclipse)로 실행되지 않습니다.

파일을 내보내기 일식에서 오류 또는 경고를 생성하지 : 여기

Manifest-Version: 1.0 
Class-Path: . 
Main-Class: gameaspects.SourceCodeVersion9 

내보내기 인터페이스입니다.

java.lang.reflect.InvocationTargetException 
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) 
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) 
    at java.lang.reflect.Method.invoke(Unknown Source) 
    at     com.sun.javafx.application.LauncherImpl.launchApplicationWithArgs(LauncherImpl.java:389) 
    at com.sun.javafx.application.LauncherImpl.launchApplication(LauncherImpl.java:328) 
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) 
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) 
    at java.lang.reflect.Method.invoke(Unknown Source) 
    at sun.launcher.LauncherHelper$FXHelper.main(Unknown Source) 
Caused by: java.lang.RuntimeException: Exception in Application start method 
    at com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:917) 
    at com.sun.javafx.application.LauncherImpl.lambda$launchApplication$155(LauncherImpl.java:182) 
    at java.lang.Thread.run(Unknown Source) 
Caused by: java.nio.file.NoSuchFileException: .\music 
    at sun.nio.fs.WindowsException.translateToIOException(Unknown Source) 
    at sun.nio.fs.WindowsException.rethrowAsIOException(Unknown Source) 
    at sun.nio.fs.WindowsException.rethrowAsIOException(Unknown Source) 
    at sun.nio.fs.WindowsFileAttributeViews$Basic.readAttributes(Unknown Source) 
    at sun.nio.fs.WindowsFileAttributeViews$Basic.readAttributes(Unknown Source) 
    at sun.nio.fs.WindowsFileSystemProvider.readAttributes(Unknown Source) 
    at java.nio.file.Files.readAttributes(Unknown Source) 
    at java.nio.file.FileTreeWalker.getAttributes(Unknown Source) 
    at java.nio.file.FileTreeWalker.visit(Unknown Source) 
    at java.nio.file.FileTreeWalker.walk(Unknown Source) 
    at java.nio.file.FileTreeIterator.<init>(Unknown Source) 
    at java.nio.file.Files.find(Unknown Source) 
    at gameaspects.SourceCodeVersion9.start(SourceCodeVersion9.java:81) 
    at com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$162(LauncherImpl.java:863) 
    at com.sun.javafx.application.PlatformImpl.lambda$runAndWait$175(PlatformImpl.java:326) 
    at com.sun.javafx.application.PlatformImpl.lambda$null$173(PlatformImpl.java:295) 
    at java.security.AccessController.doPrivileged(Native Method) 
    at com.sun.javafx.application.PlatformImpl.lambda$runLater$174(PlatformImpl.java:294) 
    at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95) 
    at com.sun.glass.ui.win.WinApplication._runLoop(Native Method) 
    at com.sun.glass.ui.win.WinApplication.lambda$null$148(WinApplication.java:191) 
    ... 1 more 

예외 실행중인 응용 프로그램 gameaspects.SourceCodeVersion9

나는 이것이이되는 참조하고 있다고 생각 코드 :

List<String> result = Files.find(Paths.get(".\\music"), 100, 
     (p, a) -> p.toString().toLowerCase().endsWith(".mp3")) 
     .map(path -> path.toString()) 
     .collect(Collectors.toList()); 

나는 다음과 같은 오류가 CMD에서 응용 프로그램을 실행

. \ music은 내 응용 프로그램에있는 소스 폴더 music을 참조합니다.

이 문제를 진단하기 위해 다른 정보가 필요한 경우 아래에 의견을 말하고 추가하겠습니다.

+0

@fabian 편집 된 질문. 오류를 제공하겠습니다. –

+0

확인 cmd에서 제공 한 오류를 사용하여 오류를 수정하고 수정했습니다. 그러나 List 메서드를 변경하여 동일한 파일 이름을 두 번 지정하지 않는 방법을 알고 싶습니다. –

+0

BTW : 경로는 기본적으로 상대 경로입니다. '. \\': Paths.get ("music")'을 추가 할 필요가 없습니다. 파일 복제의 경우 : ['Stream.distinct'] (https://docs.oracle.com/javase/8/docs/api/java/util/stream/Stream.html#distinct--)를 사용하거나 기존 목록을 가지고,'Set'을 사용하고, 목록을 통해'set.add (element)'가'false'를 반환하는 모든 요소를 ​​제거하십시오 – fabian

답변

1

명령 프롬프트에서 java -jar FileName.jar을 사용한 다음 스택 추적을 사용하여 코드를 디버깅하여 응용 프로그램에서 오류를 찾을 수있었습니다.