当前位置:  技术问答>java相关

How to run Java applications in command line?

    来源: 互联网  发布时间:2015-01-23

    本文导语:  主  题:How to run Java applications ? 作  者:Kelvin9230 所属论坛:Java 问题点数:24 回复次数:8 人气指数:54 发表时间:2001-8-10 11:09:48   I use JBuilder2 to compile an application generated by application wizard. It outputs...

主  题:How to run Java applications ?
作  者:Kelvin9230
所属论坛:Java
问题点数:24
回复次数:8
人气指数:54
发表时间:2001-8-10 11:09:48
 
I use JBuilder2 to compile an application generated by application wizard. It outputs some class files. What I want to know is how can I use Java virtual machine to load the application and run it. I setup the environments correctlly. But, when I use jre.exe to run the application in command line, an error information will show: Class not found. I began to learn Java 3 days ago. So this information confuses me. Is there anyone who can tell me how to do ? I have referenced the help documents, but it does not work.  

  


回复贴子: 
 hexiaofeng(java爱好者) 回复于2001-8-10 12:37:18 得24分  
javac j.java
java j  
 panq() 回复于2001-8-10 12:43:02 得0分  
把class所在的路径 设到classpath中
如果是jdk1.3只用设path中
 
 kare(小李飞刀的飞,小李飞刀的刀。) 回复于2001-8-10 13:20:41 得0分  
C:Borlandjbuilder5jdk1.3binjavaw -classpath "D:KareAutoAnswerclasses;C:Borlandjbuilder5libjbcl.jar;C:Borlandjbuilder5libdx.jar;C:Borlandjbuilder5libbeandt.jar;C:Borlandjbuilder5jdk1.3demojfcJava2DJava2Demo.jar;C:Borlandjbuilder5jdk1.3jrelibi18n.jar;C:Borlandjbuilder5jdk1.3jrelibjaws.jar;C:Borlandjbuilder5jdk1.3jrelibrt.jar;C:Borlandjbuilder5jdk1.3jrelibsunrsasign.jar;C:Borlandjbuilder5jdk1.3libdt.jar;C:Borlandjbuilder5jdk1.3libtools.jar"  yourPackage.mainclassname 

这是用JB5,JB2只需将相应的.jar及其路径改一下就可以了,建议你用JB5吧
 
 Kelvin9230() 回复于2001-8-10 13:23:50 得0分  
To : hexiaofeng(java爱好者)

I successfully compiled test.java, but can not run it. Error message are printed. I do what panq told me, but also failed.

D:javaprojtest>javac test.java
AppAccelerator(tm) 1.1.034 for Java (JDK 1.1), x86 version.
Copyright (c) 1998 Borland International. All Rights Reserved.

D:javaprojtest>java test
AppAccelerator(tm) 1.1.034 for Java (JDK 1.1), x86 version.
Copyright (c) 1998 Borland International. All Rights Reserved.
Can't find class test

D:javaprojtest>

The following is the directory that contains my application.
D:javaprojtest>dir

Volume in drive D is WINDOWS98
Volume Serial Number is 1272-1BE2
Directory of D:javaprojtest

.                      08-10-01  11:17 .
..                    08-10-01  11:17 ..
OPENFILE GIF        1,132  08-10-01  11:17 openFile.gif
HELP    GIF          118  08-10-01  11:17 help.gif
CLOSEF~1 GIF        1,154  08-10-01  11:17 closeFile.gif
TEST~1  CLA        1,149  08-10-01  13:11 test.class
TEST~1  JAV        1,442  08-10-01  11:17 test.java
FRAME~1  JAV        2,674  08-10-01  11:17 Frame.java
FRAME~1  CLA        3,371  08-10-01  13:11 Frame.class
FRAME_~2 JAV        3,102  08-10-01  11:17 Frame_AboutBox.java
FRAME$~2 CLA          576  08-10-01  13:11 Frame$1.class
FRAME$~3 CLA          577  08-10-01  13:11 Frame$2.class
FRAME_~2 CLA        3,634  08-10-01  13:11 Frame_AboutBox.class
        11 file(s)        18,929 bytes
        2 dir(s)      29,360.34 MB free

D:javaprojtest>

To panq:
I do what you told me, but failed. My JDK is version 1.1

Help me please. I want to develop an internet browser using JAVA.
 
 hexiaofeng(java爱好者) 回复于2001-8-10 13:27:57 得0分  
set classpath=%ClASSPATH%;.

在运行试试  
 Kelvin9230() 回复于2001-8-10 13:30:08 得0分  
To kare(小李飞刀的飞,小李飞刀的刀。):

The following is my environments. I set it using the batch file "setvars.bat"

D:JBuilder2 is the directory where I install java builder.

D:javaprojtest>set
TMP=C:WINDOWSTEMP
TEMP=C:WINDOWSTEMP
PROMPT=$p$g
winbootdir=C:WINDOWS
COMSPEC=C:COMMAND.COM
windir=C:WINDOWS
BLASTER=A220 I5 D1 T4 P300
PATH=D:JBUILD~1BIN;D:JBUILD~1JAVABIN;C:WINDOWS;C:WINDOWSCOMMAND
CLASSPATH=.;d:jbuilder2bin;d:jbuilder2javabin;d:jbuilder2libjbcl2.0.jar;
d:jbuilder2libjbcl2.0-res.jar;d:jbuilder2libjgl3.1.0.jar;d:jbuilder2libswingall.jar;d:jbuilder2libdatastore2.0.jar;d:jbuilder2libdatastore2.0-res
.jar;d:jbuilder2libjcbwt.jar;d:jbuilder2libjcchart.jar;d:jbuilder2libjc
table.jar;d:jbuilder2libvbjorb.jar;d:jbuilder2libvbjapp.jar;d:jbuilder2l
ibvbjgk.jar;d:jbuilder2libvbjtools.jar;d:jbuilder2samples;d:javaclasses;
d:javaproj;d:jbuilder2javalibclasses.zip;
JAVA_COMPILER=javacomp
JAVA_HOME=d:jbuilder2java
JBUILDER_HOME=d:jbuilder2
CMDLINE=java test

D:javaprojtest>



I think that the environment is no ploblem.

 
 Kelvin9230() 回复于2001-8-10 13:34:56 得0分  
To hexiaofeng(java爱好者):

Failed again.  
 Kelvin9230() 回复于2001-8-10 13:52:24 得0分  
Sorry I do know how to add you score.
There is some mistake.  



|
come in here

    
 
 
 
本站(WWW.)旨在分享和传播互联网科技相关的资讯和技术,将尽最大努力为读者提供更好的信息聚合和浏览方式。
本站(WWW.)站内文章除注明原创外,均为转载、整理或搜集自网络。欢迎任何形式的转载,转载请注明出处。












  • 相关文章推荐
  • how to do it in java:'A'->65 和 65->'A'
  • how to use the statement"reurn'in java?
  • how to learn java
  • how change String "yyyy-mm-dd" to java.sql.date
  • How to write services with Java program
  • 在www.java.sun.com网站down下来的j2ee tutorail,提到How to Build and Run the Examples,里面有不明的地方,请帮帮忙,谢谢!!!
  • how to input chinese?
  • UNIX下how to 查找所有的文件夹下的文件?
  • how to use sscanf?
  • how to uninstall the netscape6.2 in rh linux71
  • why can't i input chinese ? where? and how to do?
  • How to use "PATH"?
  • how can i install rpm files in linux?
  • how to input chinese in linux
  • how to use usb-storage in read hat linux?
  • how to use 'this' in EJB?
  • How to set proxy IP at Redhat8.0?
  • how to use chinese in redhat8.0
  • how to update the mbr
  • how to avoid checking for new hardware on initializing?
  • how to exit x server?
  • how to compare two string
  • how to logout
  • How to set tab behavior in emacs?
  • How to install Debian from Virtualbox
  • where can i download simsun, and how can i use it?


  • 站内导航:


    特别声明:169IT网站部分信息来自互联网,如果侵犯您的权利,请及时告知,本站将立即删除!

    ©2012-2021,,E-mail:www_#163.com(请将#改为@)

    浙ICP备11055608号-3