我想在SoapUI 5.3.0中執行一個Groovy腳本,它導入在JDK 1.8中編譯的jar文件。但是,由於SoapUI 5.3.0使用1.7;我收到一個異常「不支持major.minor版本52.0」。無法解析不支持的major.minor版本52.0
我試圖按照下面的鏈接,但無法解決它。
http://chat.stackoverflow.com/rooms/127289/discussion-between-rao-and-user5653362
我明白我需要修改用C soapui.bat:\ Program Files文件\ SmartBear \了SoapUI-5.3.0/bin文件夾;所以SoapUI開始使用Java 1.8;但不完全確定要改變哪個屬性。
我soaupui.bat看起來象下面這樣:
*
@echo off
set SOAPUI_HOME=%~dp0
if exist "%SOAPUI_HOME%..\jre\bin" goto SET_BUNDLED_JAVA
if exist "%JAVA_HOME%" goto SET_SYSTEM_JAVA
echo JAVA_HOME is not set, unexpected results may occur.
echo Set JAVA_HOME to the directory of your local JDK to avoid this message.
goto SET_SYSTEM_JAVA
:SET_BUNDLED_JAVA
set JAVA=%SOAPUI_HOME%..\jre\bin\java
goto END_SETTING_JAVA
:SET_SYSTEM_JAVA
set JAVA=java
:END_SETTING_JAVA
rem init classpath
set OLDDIR=%CD%
cd /d %SOAPUI_HOME%
set CLASSPATH=%SOAPUI_HOME%soapui-5.3.0.jar;%SOAPUI_HOME%..\lib\*
"%JAVA%" -cp "%CLASSPATH%" com.eviware.soapui.tools.JfxrtLocator > %TEMP%\jfxrtpath
set /P JFXRTPATH= < %TEMP%\jfxrtpath
del %TEMP%\jfxrtpath
set CLASSPATH=%CLASSPATH%;%JFXRTPATH%
rem JVM parameters, modify as appropriate
set JAVA_OPTS=-Xms128m -Xmx1024m -XX:MinHeapFreeRatio=20 -XX:MaxHeapFreeRatio=40 -Dsoapui.properties=soapui.properties "-Dsoapui.home=%SOAPUI_HOME%\" -splash:SoapUI-Spashscreen.png
if "%SOAPUI_HOME%" == "" goto START
set JAVA_OPTS=%JAVA_OPTS% -Dsoapui.ext.libraries="%SOAPUI_HOME%ext"
set JAVA_OPTS=%JAVA_OPTS% -Dsoapui.ext.listeners="%SOAPUI_HOME%listeners"
set JAVA_OPTS=%JAVA_OPTS% -Dsoapui.ext.actions="%SOAPUI_HOME%actions"
set JAVA_OPTS=%JAVA_OPTS% -Djava.library.path="%SOAPUI_HOME%\"
set JAVA_OPTS=%JAVA_OPTS% -Dwsi.dir="%SOAPUI_HOME%..\wsi-test-tools"
rem uncomment to disable browser component
rem set JAVA_OPTS=%JAVA_OPTS% -Dsoapui.browser.disabled="true"
:START
rem ********* run soapui ***********
"%JAVA%" %JAVA_OPTS% com.eviware.soapui.SoapUI %*
cd /d %OLDDIR%
*
PATH變量如下:
G:......;E:\Learning\JAVA\jdk1.8\bin
請幫助。
我的系統中安裝了Java 8。你能否指出我需要更改哪個屬性,以便選擇1.8? –
非常感謝Aubin!它的工作:) –
雖然我有一個後續問題。當我從命令提示符(soapui.bat)啓動SoapUI時,Java版本(在幫助>系統屬性下)顯示爲1.8,並按預期執行Groovy代碼。但是,如果我使用C:\ Program Files \ SmartBear \ SoapUI-5.3.0> bin文件夾下的圖標打開SoapUI,則幫助>系統屬性下的Java版本顯示爲1.7;並且明顯地再現了我早些時候的主要版本的問題。任何想法如何確保SoapUI圖標也以適當的java版本(1.8)打開SoapUI? –