Java compiler error - cannot run compiled java applications

Using the Java SDK with TextPad

Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard

Post Reply
alienscum

Java compiler error - cannot run compiled java applications

Post by alienscum »

Hello!
I just installed Textpad on my new computer, because I´m gonna use it to write java code.
But the key commands, Ctrl+1 for compiling and Ctrl+2 for building don´t work...?

On my old computer, where I also have Textpad installed, there I can compile and run java applications.

I took a look at the configurations and saw Tools->Add program.
I added the java compiler "javac.exe" and the java runner "java.exe".

At this moment I can compile my applications, but I still cannot run them. This is what I get:

Code: Select all

java.lang.NoClassDefFoundError: C:\Documents and Settings\My Username\Programming\javaapplication/java
Exception in thread "main" 
Tool completed with exit code 1 
I opened the Environment Variables (Windows XP) and edited the User variable "path" so it looks like

Code: Select all

C:\Microsoft Visual Studio\Common\Tools\WinNT;C:\Microsoft Visual Studio\Common\MSDev98\Bin;C:\Microsoft Visual Studio\Common\Tools;C:\Microsoft Visual Studio\VC98\bin ; C:\Sun\j2sdk1.4.2_04\bin 
And the variable Path (note the capital P) in System variables I have

Code: Select all

%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem ; C:\Sun\j2sdk1.4.2_04\bin
Is all that correct?

What is wrong?

EDIT: I have searched and found threads where guys try to explain how to solve the problem, by include something in the PATH variable. The problem is that i don´t know a damn thing about that.
Isn´t there any easier way to solve this frustrating problem?

I tried to compile my app in the console (command.exe) and when I typed "java.exe myApp.java" then I got EXACTLY the same error output as in Textpad.
Did I type "java.exe myApp" (without .java as file exstension), then i WORKED!

So I suppose Textpad is trying to run my application with the extension .java.
How do I get it to run it without it?

I also have another problem.
When I get a compiling error, then I cannot jump to the line as Textpad refers to, as I could before. How do I solve that problem?
User avatar
s_reynisson
Posts: 939
Joined: Tue May 06, 2003 1:59 pm

Post by s_reynisson »

Sounds like you installed the Java commands manually, remove them and install using the built in function in TP. See the Java FAQ, "How do I add the JDK commands?". I hope that helps.
Then I open up and see
the person fumbling here is me
a different way to be
Post Reply