wood burning stoves 2.0*
The moose likes Beginning Java and the fly likes Problems executing programs Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Problems executing programs" Watch "Problems executing programs" New topic
Author

Problems executing programs

James MacDonald-Fawcett
Greenhorn

Joined: Nov 17, 2003
Posts: 4
Hey y'all!
Im having a couple of problems at the moment, I've installed Java environment (which worked on my old computer) onto my new laptop. I can compile the files using javac.exe, but when i come to run them using java.exe it throws up a runtime error mentioning the "main" thread. Im not sure what this means as the files ran fine on my university network and old home computer.
Please Help!
James
P.S With the new downloadable Java Environment why isn't there a javac.exe file? This got me very confused!
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336


it throws up a runtime error mentioning the "main" thread.

Well we could guess what the error is (and many here probably have a pretty good idea what it will be). But far easier for all involved is if you tell us what the error actually is.
[ June 28, 2004: Message edited by: Paul Sturrock ]

JavaRanch FAQ HowToAskQuestionsOnJavaRanch
Blake Minghelli
Ranch Hand

Joined: Sep 13, 2002
Posts: 331
it throws up a runtime error mentioning the "main"

Can you post the entire error message? I'm sure you are referring to "Exception in thread main..." but that is a very general error that just says "something bad happened, read the rest for further details".

I'm guessing that the rest of the error may include "java.lang.NoClassDefFoundError" but without the whole error message, that's a complete stab in the dark. If that is the problem, then it is a CLASSPATH issue - i.e. the class you are trying to execute is not in your CLASSPATH.

P.S With the new downloadable Java Environment why isn't there a javac.exe file? This got me very confused!

You can get "Java" one of 2 ways:
1. Just the JRE - If you do not need to create Java classes, just run them, then this is all you need. It contains the "runtime" libraries. But it does not include the development tools, like javac.exe. This sounds like what you recently downloaded.
2. The full SDK - This includes the JRE and many tools a Java developer needs like javac.exe.


Blake Minghelli<br />SCWCD<br /> <br />"I'd put a quote here but I'm a non-conformist"
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Problems executing programs
 
Similar Threads
JRE version conflict problem
Exception in thread "main" java.lang.NoClassDefFoundErorr: com/sun/tools/javac/Main
catlle drive oop-1 to 4
how do you recognize javac as an internal or external command (compiler error)
Problems compiling HelloWorld