Results 1 to 7 of 7
- 02-06-2009, 03:41 PM #1
Member
- Join Date
- Feb 2009
- Posts
- 11
- Rep Power
- 0
Running .java-files won't work/compile does!(Code inside)
Hey there and sorry for the strange Topicname but i could not found any short description for my problem since i don't even know what kind of problem it is!
I have downloaded the jdk6.12 from the sun homepage, installed it and set the path (i hope i did that correctly,using windows xp).
To check out if everything is working correctly i tried to write a small Programm and run it and there lies the problem. Compiling any code will work without mistakes but i cannot run the code, it always gives me this message and i dont know what it does mean:
jdk is installed to c:\programm files\java\jdk...Java Code:D:\Java>java ShortBsp.java Exception in thread "main" java.lang.NoClassDefFoundError: ShortBsp Caused by: java.lang.ClassNotFoundException: ShortBsp.java at java.net.URLClassLoader$1.run(URLClassLoader.java:200) at java.security.AccessController.doPrivileged(Native Metho at java.net.URLClassLoader.findClass(URLClassLoader.java:18 at java.lang.ClassLoader.loadClass(ClassLoader.java:307) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java at java.lang.ClassLoader.loadClass(ClassLoader.java:252) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java Could not find the main class: ShortBsp.java. Program will exit.
Java-Files are at D:\Java
My steps to create a programm:
open notepad, type the code and store it in the folder.
cmd -> CD D:\Java
javac ShortBsp.java
java ShortBsp
It would be really cool if somebody could tell me how to solve this problem! So far i have found a lot of threads of people who had a similar problem but i have yet not found a solution!
Sys
wyldstyle
- 02-06-2009, 04:42 PM #2
Senior Member
- Join Date
- Sep 2008
- Posts
- 564
- Rep Power
- 5
what does your class declaration in your code look like?
- 02-06-2009, 05:12 PM #3
Member
- Join Date
- Feb 2009
- Posts
- 11
- Rep Power
- 0
Its really strange, there is no error message if i try to compile, verything works and the compiler will create a .class file also! Dont wonder about the code...i know it makes no sense!Java Code:class ShortBsp{ public static void main (String[] args){ int[] test = new int[8]; System.out.println("Test:D"); } }Last edited by wyldstyle; 02-06-2009 at 05:17 PM.
- 02-06-2009, 05:35 PM #4
Running a Java program...
Some basics...D:\Java>java ShortBsp.java
- To compile: javac ShortBsp.java
- To run: java ShortBsp (don't add the .java extention)
Luck,
CJSLChris S.
Difficult? This is Mission Impossible, not Mission Difficult. Difficult should be easy.
- 02-06-2009, 06:36 PM #5
Senior Member
- Join Date
- Sep 2008
- Posts
- 564
- Rep Power
- 5
nice, i didn't notice that. heh
- 02-06-2009, 07:01 PM #6
Member
- Join Date
- Feb 2009
- Posts
- 11
- Rep Power
- 0
Oh my god, sorry. I am such an idiot ;/.
- 02-06-2009, 08:05 PM #7
Similar Threads
-
Running batch files thraugh java by passing parameters
By pradeesh in forum New To JavaReplies: 1Last Post: 01-16-2009, 10:14 AM -
Compile/Execute code in Java app
By Doctor Cactus in forum New To JavaReplies: 5Last Post: 12-16-2008, 09:58 AM -
Running batch files in java
By pradeesh in forum New To JavaReplies: 10Last Post: 12-04-2008, 09:26 PM -
auto-compile won't work on svn import
By anacapa in forum EclipseReplies: 0Last Post: 10-10-2008, 04:46 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks