在IBM i上運行jar(as400 / iSeries)

[英]Run jar on IBM i (as400 / iSeries)


I'm working with IBM i (often called an AS/400 server).

我正在使用IBM i(通常稱為AS / 400服務器)。

Currently I have been able to create .CLASS files and run perfectly

目前我已經能夠創建.CLASS文件並完美運行

in as400 Directory (I think it's called IFS or something like) a have my tree like:

在as400目錄(我認為它被稱為IFS或類似的東西)a我的樹像:

/
+--Javacfd/
   +--bin/
      +--com/
         +---company/
             Class1.class
             Class2.class    
             Hello.class
             Server.class
             +---other/
                 Other.class
                 Another.class
                 Etc.class

When I run RUNJVA CLASS('com.company.Hello') Works well! Or RUNJVA CLASS('com.company.other.Other')

當我運行RUNJVA CLASS('com.company.Hello')效果很好!或RUNJVA CLASS('com.company.other.Other')

Now I need run a executable jar

現在我需要運行一個可執行jar

In windows java -jar my-jar.jar Works well

在windows java -jar my-jar.jar中運行良好

I as400 I tried

我嘗試了as400

RUNJVA CLASS('hello.Application') CLASSPATH(':\Javacfd\bin\my-jar.jar')    

I get

我明白了

Exception in thread "main" java.lang.NoClassDefFoundError: hello.Application

線程“main”中的異常java.lang.NoClassDefFoundError:hello.Application

RUNJVA CLASS('hello.Application') CLASSPATH('Javacfd\bin\my-jar.jar') 

I get

我明白了

Exception in thread "main" java.lang.NoClassDefFoundError: hello.Application

線程“main”中的異常java.lang.NoClassDefFoundError:hello.Application

RUNJVA CLASS('hello.Application') CLASSPATH('\Javacfd\bin\my-jar.jar') 

I get

我明白了

Exception in thread "main" java.lang.NoClassDefFoundError: hello.Application

線程“main”中的異常java.lang.NoClassDefFoundError:hello.Application

RUNJVA CLASS('hello.Application') 

I get

我明白了

Exception in thread "main" java.lang.NoClassDefFoundError: hello.Application

線程“main”中的異常java.lang.NoClassDefFoundError:hello.Application

Note hello is package and Application is a Main class. Jar file is locale in \Javacfd\bin\my-jar.jar

注意hello是包,Application是Main類。 Jar文件是\ Javacfd \ bin \ my-jar.jar中的語言環境

I'm doing wrong?

我做錯了?

1 个解决方案

#1


5  

Assuming the jar contains a proper manifest you specify the jar file on the RUNJVA command CLASS parameter:

假設jar包含正確的清單,您可以在RUNJVA命令CLASS參數上指定jar文件:

RUNJVA CLASS('/Javacfd/bin/my-jar.jar')

You can also use the standard java tools and utilities through the Qshell interpreter:

您還可以通過Qshell解釋器使用標准的java工具和實用程序:

QSH CMD('java -jar /Javacfd/bin/my-jar.jar')

注意!

本站翻译的文章,版权归属于本站,未经许可禁止转摘,转摘请注明本文地址:https://www.itdaan.com/blog/2015/08/06/6c1718516355eba1d24bcb41b30ee4cc.html



 
粤ICP备14056181号  © 2014-2020 ITdaan.com