2016-02-18 13 views
6

पर ग्रहण आरसीपी अनुप्रयोग लॉन्च करने में असमर्थ मैं जावा 1.6 के साथ ग्रहण इंडिगो प्लगइन का उपयोग कर ओएस एक्स पर शैल स्क्रिप्ट का उपयोग करके एक ग्रहण आरसीपी अनुप्रयोग लॉन्च करने का प्रयास कर रहा हूं।ओएस एक्स

#!/bin/bash 
DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" 
app_cmd="\"$DIR/../Resources/jre/Contents/Home/bin/java\" 
-XstartOnFirstThread 
-Xdock:name=GS\ Risk 
-Xdock:icon=\"$DIR/../Resources/AppIcon.ico\" 
-Dorg.eclipse.swt.internal.carbon.smallFonts 
-Dosgi.console.enable.builtin=true 
-jar \"$DIR/../Resources/plugins/org.eclipse.equinox.launcher_1.2.0.v20110502.jar\" 
-data @noDefault 
-Dfile.encoding=UTF-8 
-os macosx 
-ws cocoa 
-arch x86_64 
-nl en_US 
-consoleLog 
-console 
-showsplash 
AppName" 

runCommand() { 
    typeset cmnd="$*" 
    typeset ret_code 
    echo cmnd=$cmnd 
    eval $cmnd 
    ret_code=$? 
    case $ret_code in 
    0) 
     printf "[%s] exit OK." "$NAME" 
     ;; 
    23) 
     printf "[%s] requested a restart. Restarting..." "$NAME" r 
     unCommand "$cmnd" 
     ;; 
    *) 
     printf "Error : [%d] when executing command: '$cmnd'" $ret_code 
     ;; 
    esac 
    printf "\n" 
    exit $ret_code 
} 

runCommand "$app_cmd" 

मैं निम्न त्रुटि हो रही है:

!SESSION Thu Feb 18 21:50:11 GMT+05:30 2016 ------------------------------------ 
!ENTRY org.eclipse.equinox.launcher 4 0 2016-02-18 21:50:11.660 
!MESSAGE Exception launching the Eclipse Platform: 
!STACK 
java.lang.RuntimeException: Could not find framework 
    at org.eclipse.equinox.launcher.Main.getBootPath(Main.java:978) 
    at org.eclipse.equinox.launcher.Main.basicRun(Main.java:557) 
    at org.eclipse.equinox.launcher.Main.run(Main.java:1410) 
    at org.eclipse.equinox.launcher.Main.main(Main.java:1386) 

क्या कारण हो सकता है OS का संस्करण 10.11.3 स्क्रिप्ट प्रकार कार्य करता है?

+0

यह वही त्रुटि दे रहा है और किसी भी तरह से सिस्टम vm का उपयोग कर रहा है भले ही मैं plist या ini फ़ाइल को अद्यतन करता हूं। एप्लिकेशन को विशिष्ट jre –

+0

का उपयोग करने की आवश्यकता है अपनी फ़ाइलों को किसी अन्य टूल से अनजिप करने का प्रयास करें और अपने पथ, फ़ोल्डर + फ़ाइल नामों की जांच करें .... स्रोत: https://www.eclipse.org/forums/index.php/t/ 240 9 3/ – Joda

+0

कोई ज़िप नहीं है। मैं एक इंस्टॉलर –

उत्तर

2

ऐसा लगता है कि जावा कमांड के साथ यह समस्या है जो इसे चलाने वाले बैश कोड के बजाए चलाया जाता है, लेकिन बैश कोड में ऐसी समस्याएं हैं जो डीबग करना मुश्किल बनाती हैं। एक समस्या यह है कि एक स्ट्रिंग का उपयोग कमांड, विकल्प और तर्कों को संग्रहीत करने के लिए किया जाता है। यह आम तौर पर एक बुरा विचार है क्योंकि यह पथनाम विस्तार (ग्लोबिंग) और शब्द विभाजन के साथ समस्याओं से बचना मुश्किल बनाता है। एक और समस्या eval का उपयोग है, जो सबसे अच्छी तरह से बचाया जाता है, और शायद ही कभी आवश्यक है।

#!/bin/bash 

DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" 

app_cmd_parts=(
    "$DIR/../Resources/jre/Contents/Home/bin/java" 
    -XstartOnFirstThread 
    -Xdock:name='GS Risk' 
    -Xdock:icon="$DIR/../Resources/AppIcon.ico" 
    -Dorg.eclipse.swt.internal.carbon.smallFonts 
    -Dosgi.console.enable.builtin=true 
    -jar "$DIR/../Resources/plugins/org.eclipse.equinox.launcher_1.2.0.v20110502.jar" 
    -data @noDefault 
    -Dfile.encoding=UTF-8 
    -os macosx 
    -ws cocoa 
    -arch x86_64 
    -nl en_US 
    -consoleLog 
    -console 
    -showsplash 
    AppName 
) 

runCommand() { 
    typeset cmd_parts=("[email protected]") 
    typeset ret_code 
    printf 'cmd_parts=(' 
    printf ' %q' "${cmd_parts[@]}" 
    printf ')\n' 
    "${cmd_parts[@]}" 
    ret_code=$? 
    case $ret_code in 
    0) 
     printf "[%s] exit OK." "$NAME" 
     ;; 
    23) 
     printf "[%s] requested a restart. Restarting..." "$NAME" runCommand "${cmd_parts[*]}" 
     ;; 
    *) 
     printf "Error : [%d] when executing command: '${cmd_parts[*]}'" $ret_code 
     ;; 
    esac 
    printf "\n" 
    exit $ret_code 
} 

runCommand "${app_cmd_parts[@]}" 

यह डिबग करने के लिए आसान होना चाहिए: इस कोड सरणियों का उपयोग करता है आदेश स्टोर करने के लिए और 'eval' का उपयोग नहीं करता की एक थोड़ा संशोधित संस्करण है। यह देखने के लिए कि यह क्या कर रहा है, इसे bash -x के साथ चलाएं। कार्यक्रम चलाए गए जावा कमांड को फिर से चलाने के लिए cmd_parts=(...) आउटपुट में ब्रैकेट के बीच टेक्स्ट को कॉपी और पेस्ट करें। उम्मीद है कि यह आपको यह निर्धारित करने में सक्षम करेगा कि आदेश के साथ क्या गलत है, और इसे कैसे ठीक किया जाए।

+0

अच्छा * कोई * एफएक्यू एफएक्यू 50! – miken32