• Post Reply Bookmark Topic Watch Topic
  • New Topic

need help(noob)  RSS feed

 
Zach Williams
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have my .class file but I am struggling to run it in the JVM. How do I do this?
 
Mohamed Sanaulla
Bartender
Posts: 3185
34
Google App Engine Java Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please UseAMeaningfulSubjectLine.

You would have to update your classpath settings in the environment variable to include the lib folder of the JDK installation as well as the current working directory.

Also you can use -cp option of the java to specify the class path.

Navigate to the directory where your class files are stored.


(dont use the .class extension and MyClass should be the entry point for your application)
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Check this tutorial.
 
Campbell Ritchie
Marshal
Posts: 56553
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you haven't messed up things by setting a system classpath, you simply navigate to the appropriate directory and write


java Foo
 
marc weber
Sheriff
Posts: 11343
Java Mac Safari
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
mohamed sanaullah wrote:... You would have to update your classpath settings in the environment variable to include the lib folder of the JDK installation as well as the current working directory...

Please do not set a system/environment classpath if you can help it.

(And if you do set one, the JRE's "lib" directory does not need to be included.)
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!