Community
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Textpad + Java 64 bit for windows 7 (unique problem)

 
Post new topic   Reply to topic    Community Forum Index -> Java
View previous topic :: View next topic  
Author Message
darethas



Joined: 22 Mar 2010
Posts: 5

PostPosted: Mon Mar 22, 2010 6:59 am    Post subject: Textpad + Java 64 bit for windows 7 (unique problem) Reply with quote

Hi, I read over many Textpad and java threads for windows 7 and noticed most of them had the same problem: "Whoops, forgot to point to the tools myself!"

I reguard myself as highly advanced in the ability to use computers and figure things out, however I myself, including my instructor are stumped here as to why I cannot get Textpad to RUN programs on my system. Please take note that I am able to COMPILE them because I properly pointed to the javac in the /bin folder. However, when I attempt to run the .java file that I recently compiled, I always recieve this same exact error.

Quote:
ava.lang.NoClassDefFoundError: C:\Users\Dimitri\Desktop\Test/java
Caused by: java.lang.ClassNotFoundException: C:\Users\Dimitri\Desktop\Test.java
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
Could not find the main class: C:\Users\Dimitri\Desktop\Test.java. Program will exit.
Exception in thread "main"
Tool completed with exit code 1


Mind you,I have....:
a.) written my code propery (just a simple System.out.println statement, )
b.) named the .java file the same as my public class in the same case and everything.
c.) even tried modifiing the enviroment variables (albeit not sure if it is exactly right, I have indeed tried it, within textpad, and actually through windows.)

So, me and my Java instructor are stumped. Once again I am aware of what that exception means, and do not understand why it is happening. I am able to COMPILE but not RUN. Please help.
Back to top
View user's profile Send private message
talleyrand



Joined: 21 Jul 2003
Posts: 626
Location: Kansas City, MO, USA

PostPosted: Mon Mar 22, 2010 3:10 pm    Post subject: Reply with quote

Do you receive the same results if you attempt to run the java application from the command line? Actual location of java.exe will depend on your version but approximately this.

C:\>"C:\Program Files\Java\jre6\bin\java.exe" C:\Users\Dimitri\Desktop\Test
_________________
I choose to fight with a sack of angry cats.
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger
darethas



Joined: 22 Mar 2010
Posts: 5

PostPosted: Mon Mar 22, 2010 7:22 pm    Post subject: Reply with quote

Yes the same thing happens.

By the way you had it right with the location and everything too
Back to top
View user's profile Send private message
talleyrand



Joined: 21 Jul 2003
Posts: 626
Location: Kansas City, MO, USA

PostPosted: Tue Mar 23, 2010 4:01 pm    Post subject: Reply with quote

Out of curiosity, are you running

C:\>"C:\Program Files\Java\jre6\bin\java.exe" -verbose C:\Users\Dimitri\Desktop\Test

or are you running

C:\>"C:\Program Files\Java\jre6\bin\java.exe" -verbose C:\Users\Dimitri\Desktop\Test.java

Based on your error message, I now suspect the latter. Look at your error message, it indicates class not found for class Test/java

I'm sure you know this but I'm spelling it out here for future people searching on this issue.

Java compilation (javac) takes your source (.java) file and creates a binary output (.class) The syntax for doing so would be "javac MyCode.java"

Running a java program involves spinning up the Java application launcher (JVM) via the java command. The argument for this is the name of the java class file without the file extension. "java MyCode"
_________________
I choose to fight with a sack of angry cats.
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger
darethas



Joined: 22 Mar 2010
Posts: 5

PostPosted: Tue Mar 30, 2010 5:13 pm    Post subject: Reply with quote

I am compiling first then pointing to the .java to run the program. I am actually testing out with other programs and having no issues, such as jGRASP. I don't understand I keep playing with the settings hoping to find a solution but nothing is working
Back to top
View user's profile Send private message
talleyrand



Joined: 21 Jul 2003
Posts: 626
Location: Kansas City, MO, USA

PostPosted: Mon Apr 19, 2010 2:44 pm    Post subject: Reply with quote

Ah, but you don't want to point at the .java to run. You want to point at the compiled object, the .class file (but do not supply the .class extension)

Configure
Preferences...
expand Tools, find Run Java Application
Command = java.exe
Parameters = $BaseName
Initial folder = $FileDir

This would perform the same steps if you were to run the following from the command line.
C:\>"C:\Program Files\Java\jre6\bin\java.exe" C:\Users\Dimitri\Desktop\Test
_________________
I choose to fight with a sack of angry cats.
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger
clewis



Joined: 19 Oct 2010
Posts: 3

PostPosted: Tue Oct 19, 2010 1:49 pm    Post subject: Reply with quote

Thanks dude - work for me. Had same problem.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Community Forum Index -> Java All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB