Friend, you have given very little data with which to diagnose your problem.
Based on the little data that you have given, I'd say that the problem is probably with the classpath (as is the case with over 95% of Java newbie problems). Look closely at how you built the .class file. I expect that you'll find a command similar to javac.exe -classpath SOME_CLASSPATH .... . The classpath argument tells the system to use some libraries found at some path in your system. You need to specify the same classpath* to your call to java.exe. (It's not the same classpath exactly; you'll have to add the path to the recently built .class files to your classpath).
Your problem is a common one, and should be well explained in the first chapter of any good book on beginning with Java programming. I've included a link to a page that may help you.
If you can post more details, such as at least giving the exact error that you are facing, I'm sure an accurate diagnosis can be done.
2007-01-29 21:44:33
·
answer #1
·
answered by Desi Geek 2
·
0⤊
0⤋
If you have Java Run Time Environmrnt installed on your computer. You can make a html file which would include the function call to the class file you have created.
The html file you have created should call the java class file and work fine in explorer.
If you need any further clarification please get back to me,
2007-01-30 04:43:35
·
answer #2
·
answered by Sunil Saripalli 5
·
0⤊
0⤋
maybe you are running the wrong file name.
for example your filenames are::
numbers.java
you should have a class file. which is the class name of your java programs
like
ArrayRotation.class
when you compile like
javac Numbers.java
and you run
java Numbers
you will surely not be able to run it
because in java programming language..
you run the .class file
so you would want to run your program like this
java ArrayRotation
always remember that you run the .class file not the .java file
ok?
2007-01-30 05:42:16
·
answer #3
·
answered by jerome 1
·
0⤊
0⤋
you must first check if your java program is a program for java or an applet for HTML..
compile the program using javac..you need first to locate the executable program javac or Java compiler..
for example, it is located in C:/>J2sdk1.4.0/bin then type in your command prompt:
C:\>cd\
C:\>cd j2sdk1.4.0\bin
C:\j2sdk1.4.0\bin>javac clsProgram.java
providing that your program was saved in .java format, NOT .txt or text.
after compiling it, type the ff:
C:\j2sdk1.4.0\bin>java clsProgram
NOTE that you do not need to include the .java file extension because after it has been compiled, it is already a class file..
..If it still is not working, try appletviewer instead of java.......
goodluck..
2007-01-30 05:10:36
·
answer #4
·
answered by angelvein 2
·
2⤊
0⤋
I need to know as to the exact error that is displayed whle using the command "java "
2007-01-30 05:44:14
·
answer #5
·
answered by Mr.Sincere 1
·
0⤊
0⤋
ur java program may be applet based one. If it is, then using appletviewer only, u can execute it.
2007-01-30 04:45:08
·
answer #6
·
answered by kamesh 1
·
0⤊
0⤋
ur program may be in applet , for that u need appletviewer to run the program. or check ur program whether it is right.
2007-01-30 05:37:26
·
answer #7
·
answered by anshu 1
·
0⤊
0⤋
try java.com
2007-01-30 12:07:06
·
answer #8
·
answered by Sumanth 3
·
0⤊
0⤋