I can compile just fine from Textpad and run the compiled application from a DOS Window just fine (Win 98)
But have spent over 5 hours of trial and error trying to get an application to RUN from Textpad.
I have set the correct PATH in regedit
The problem has something to do with CLASSPATH at least. I can not seem to set this and keep it set, even in the DOS window. (any info on classpath would be great)
After setting up a RUN JAVA Tool from Configure Customize I get errors like;
java.lang.NoClassDefFoundError: C:\CoreJavaBook\v1ch2\Welcome\Welcome/java
Exception in thread "main" Process completed with exit code 1
My configuration looks like
command C:\jdk\bin\java.exe
parameters $File
initial folder $FileDir
I have tried many, many, many configurations but get no where.
PLEASE HELP OH GREAT ONES OF THE JAVA (TEXTPAD) REALM
Thanks.
Can not get apps to run from textpad -HELP
Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard
RE: Can not get apps to run from textpad -HELP
I think the problem is that you have to give a .class file to java exe, but what you are editing is a .java file. Try
$BaseName.class
as parameter instead of $File.
$BaseName is the name of the file in the editor without the extension.
Andreas
$BaseName.class
as parameter instead of $File.
$BaseName is the name of the file in the editor without the extension.
Andreas
RE: Can not get apps to run from textpad -HELP
Dear TextPad Gurus:
I have exactly the same problem as that of Don Mitchell. I didn't find the reply by Andreas usefull . I tried zillion times but felt more disappointed and wonder about the value of TextPad. Any guru out there help me out? I'm tired of trying more y myself.
Anybody teach me how to run an application with TextPad with the menu run Java application in tool menu. One more thing, I can compile my java applet, application and run the java applet with my lovely TextPad but until now I can't run my java application . I got the same exception like Don.
Zillion Thanks to any helper!!!!!
Luan Cao Vu
I have exactly the same problem as that of Don Mitchell. I didn't find the reply by Andreas usefull . I tried zillion times but felt more disappointed and wonder about the value of TextPad. Any guru out there help me out? I'm tired of trying more y myself.
Anybody teach me how to run an application with TextPad with the menu run Java application in tool menu. One more thing, I can compile my java applet, application and run the java applet with my lovely TextPad but until now I can't run my java application . I got the same exception like Don.
Zillion Thanks to any helper!!!!!
Luan Cao Vu
RE: Can not get apps to run from textpad -HELP
Hello
Are you trying to compile a package as we have had a few users trying to do this? You cannot put a main in a package it is simply not possible. A package is simply a named container not an executable thing. Programs can consist of any combination
of classes from any combination of packages. At least one of them must have a main if the program is intended to run as a stand alone application.
Hope this helps to explain.
Heidi
p.s. If this is not the cause of your problem please send in a support request using the form at http://www.textpad.com/support/index.html
Are you trying to compile a package as we have had a few users trying to do this? You cannot put a main in a package it is simply not possible. A package is simply a named container not an executable thing. Programs can consist of any combination
of classes from any combination of packages. At least one of them must have a main if the program is intended to run as a stand alone application.
Hope this helps to explain.
Heidi
p.s. If this is not the cause of your problem please send in a support request using the form at http://www.textpad.com/support/index.html
RE: Can not get apps to run from textpad -HELP
Okay, here it is for you guys in detail, which I think some of us have problems on. My Configure>Preference>Tools settings are as follows, which was there by default when I first installed TextPad:
Compile Java: Paramaters = $File, Initial folder = $FileDir
Run Java Application: Paramaters = $BaseName, Initial folder = $FileDir
If I compile a file that does not import/use other classes other than JDK classes, it compiles fine (and runs if it has a main()). But, if I had the following files, File#2 cannot compile in TextPad:
File#1:
package qb.fruits;
public class Banana {
.....
File#2:
package qb.fruits;
public class FruitBasket {
Banana b = new Banana();
.....
The compiler just won't compile File#2. It would just say:
Exception in thread "main" java.lang.NoClassDefFoundError: Banana
It would also not recognize classes in File#2 that is imported say from package qb.vegetables;
Anyone have solutions to this? I think it has to do with TextPad interpreting the path or classpath. I can compile this at the command line, so I know my path is set correctly in the Control Panel. It even compiles in JBuilder when I use it. It's just TextPad that is hindering this.
Vinh
Compile Java: Paramaters = $File, Initial folder = $FileDir
Run Java Application: Paramaters = $BaseName, Initial folder = $FileDir
If I compile a file that does not import/use other classes other than JDK classes, it compiles fine (and runs if it has a main()). But, if I had the following files, File#2 cannot compile in TextPad:
File#1:
package qb.fruits;
public class Banana {
.....
File#2:
package qb.fruits;
public class FruitBasket {
Banana b = new Banana();
.....
The compiler just won't compile File#2. It would just say:
Exception in thread "main" java.lang.NoClassDefFoundError: Banana
It would also not recognize classes in File#2 that is imported say from package qb.vegetables;
Anyone have solutions to this? I think it has to do with TextPad interpreting the path or classpath. I can compile this at the command line, so I know my path is set correctly in the Control Panel. It even compiles in JBuilder when I use it. It's just TextPad that is hindering this.
Vinh
RE: Can not get apps to run from textpad -HELP
Don,
If you don't have TextPad 4.3.2, please click the Download button above, and install it. Then delete all your JDK tools, and add them again, by clicking the Add button, on the Tools page of the Preferences dialog box, and choosing JDK Commands.
When you've finished, the command to run a Java application should simply be "java.exe", grayed out so that you cannot change it. TextPad needs to know about this command, so that it can treat it specially when you run it.
Note that TextPad relies on the entries that the JDK setup program puts in the registry. If you subsequently move the JDK (other than by an uninstall/reinstall), TextPad will not be able to use it.
Regards,
Keith MacDonald
Helios Software Solutions
If you don't have TextPad 4.3.2, please click the Download button above, and install it. Then delete all your JDK tools, and add them again, by clicking the Add button, on the Tools page of the Preferences dialog box, and choosing JDK Commands.
When you've finished, the command to run a Java application should simply be "java.exe", grayed out so that you cannot change it. TextPad needs to know about this command, so that it can treat it specially when you run it.
Note that TextPad relies on the entries that the JDK setup program puts in the registry. If you subsequently move the JDK (other than by an uninstall/reinstall), TextPad will not be able to use it.
Regards,
Keith MacDonald
Helios Software Solutions
RE: Can not get apps to run from textpad -HELP
Vinh,
Here's what I did to make it work, using JDK 1.3 with TextPad 4.3.2:
1. Create file Banana.java, containing:
package qb.fruits;
public class Banana {
public String color() {
return "yellow";
}
}
2. Create file FruitBasket.java, containing:
import qb.fruits.*;
public class FruitBasket {
public static void main(String[] args) {
Banana b = new Banana();
System.out.println(b.color());
}
}
3. Compile Banana.java
4. CLASSPATH is empty, so move Banana.class to .\qb.fruits\Banana.class
5. Compile FruitBasket.java
6. Running FruitBasket, prints out "yellow".
I hope this helps.
Keith MacDonald
Helios Software Solutions
Here's what I did to make it work, using JDK 1.3 with TextPad 4.3.2:
1. Create file Banana.java, containing:
package qb.fruits;
public class Banana {
public String color() {
return "yellow";
}
}
2. Create file FruitBasket.java, containing:
import qb.fruits.*;
public class FruitBasket {
public static void main(String[] args) {
Banana b = new Banana();
System.out.println(b.color());
}
}
3. Compile Banana.java
4. CLASSPATH is empty, so move Banana.class to .\qb.fruits\Banana.class
5. Compile FruitBasket.java
6. Running FruitBasket, prints out "yellow".
I hope this helps.
Keith MacDonald
Helios Software Solutions
RE: Can not get apps to run from textpad -HELP
I of course have a similar problem, but I my problem is that the Tools->Compile Java menu command is looking for the javac.exe in C:\WINNT\SYSTEM32 dir, when I actually have it in another dir on the D: drive.
I had previously installed J++ on my machine, and my registry if full of references for the msjava.dll being in the C:\WINNT\SYSTEM32 dir.
A simple solution it seems would be for TextPad to allow users to set the path of javac.exe, java.exe, and appletviewer.exe in the Configure->Preferences menu options.
Best Wishes
John Simpson
Web Application Developer
Deerfield.com
I had previously installed J++ on my machine, and my registry if full of references for the msjava.dll being in the C:\WINNT\SYSTEM32 dir.
A simple solution it seems would be for TextPad to allow users to set the path of javac.exe, java.exe, and appletviewer.exe in the Configure->Preferences menu options.
Best Wishes
John Simpson
Web Application Developer
Deerfield.com
RE: Can not get apps to run from textpad -HELP
I am having the same problem as several people in your Forum. The problem is compiling and running Java files that use the "package" keyword.
Everything worked great until I tried to put my Java files into a Java "package".
All I want to do is create two files, each the member of the SAME package: a very basic Java requirement (everything in Java comes in packages, and there are always multiple files in a package).
My Example:
// FruitBasket.java
package fruit;
public class FruitBasket{
Banana b = new Banana();
public void printOut(){
System.out.println("FruitBasket.printOut().");
b.printOut();
}
public FruitBasket(){}
public static void main(String[] args){
System.out.println("FruitBasket.main().");
}
}
// Banana.java
package fruit;
public class Banana{
public void printOut(){
System.out.println("Banana.printOut().");
}
public Banana(){}
public static void main(String[] args){}
}
Banana.java compiles ok (but depends on no outside classes). FruitBasket.java fails to compile ("cannot resolve symbol, symbol:class Banana"). It can't find the banana class! Why?
Similar to the other TextPad user's I've tried for hours....This should be very basic default stuff: putting several classes in the same package.
Help!
Everything worked great until I tried to put my Java files into a Java "package".
All I want to do is create two files, each the member of the SAME package: a very basic Java requirement (everything in Java comes in packages, and there are always multiple files in a package).
My Example:
// FruitBasket.java
package fruit;
public class FruitBasket{
Banana b = new Banana();
public void printOut(){
System.out.println("FruitBasket.printOut().");
b.printOut();
}
public FruitBasket(){}
public static void main(String[] args){
System.out.println("FruitBasket.main().");
}
}
// Banana.java
package fruit;
public class Banana{
public void printOut(){
System.out.println("Banana.printOut().");
}
public Banana(){}
public static void main(String[] args){}
}
Banana.java compiles ok (but depends on no outside classes). FruitBasket.java fails to compile ("cannot resolve symbol, symbol:class Banana"). It can't find the banana class! Why?
Similar to the other TextPad user's I've tried for hours....This should be very basic default stuff: putting several classes in the same package.
Help!