Results 1 to 9 of 9
Thread: compiling a package user created
- 12-14-2009, 07:28 PM #1
Member
- Join Date
- Dec 2009
- Posts
- 9
- Rep Power
- 0
compiling a package user created
Hi
I am tryingt o compile a bunch of .java files and a package created linkList.But keep getting the runtime error:
Exception in thread "main" java.lang.NoClassDefFoundError: LinkListTest (wrong n
ame: linkList/LinkListTest)
The LinkListTest has the main in it.this class is part of the linkList package.
Thanks
shweta
- 12-14-2009, 08:24 PM #2
Moderator
- Join Date
- Feb 2009
- Location
- New Zealand
- Posts
- 4,716
- Rep Power
- 18
I am tryingt o compile a bunch of .java files and a package created linkList.But keep getting the runtime error:
So are you trying to compile or run?
If you are trying to run the program then there is something wrong with the command you are using. It would be a good idea to say just what that command is and how it relates to the location of the various .class files involved.
A typical invocation of java.exe would look like:
Java Code:c:\whereever > java -cp . linkList.LinkListTest
where "wherever" is the directory containing the linkList directory.
- 12-14-2009, 09:17 PM #3
Member
- Join Date
- Dec 2009
- Posts
- 9
- Rep Power
- 0
Hi
I am trying to run the program.The package compiles.
tried java -cp.linkList.LinkListTest
Got:
Unrecognized option: -cp.linkList.LinkListTest
Could not create the Java virtual machine.
- 12-14-2009, 09:34 PM #4
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 14,422
- Blog Entries
- 7
- Rep Power
- 29
- 12-14-2009, 09:41 PM #5
Member
- Join Date
- Dec 2009
- Posts
- 9
- Rep Power
- 0
Hi
Still doesnot work
C:\Users\Manish\Desktop\elance\example>java -cp . linkList.LinkListTest
Exception in thread "main" java.lang.NoClassDefFoundError: linkList/LinkLi
Caused by: java.lang.ClassNotFoundException: linkList.LinkListTest
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
Could not find the main class: linkList.LinkListTest. Program will exit.
- 12-14-2009, 09:45 PM #6
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 14,422
- Blog Entries
- 7
- Rep Power
- 29
- 12-14-2009, 09:49 PM #7
Member
- Join Date
- Dec 2009
- Posts
- 9
- Rep Power
- 0
the path is C:\Users\Manish\Desktop\elance\example -> the example folder has LinkListTest.java there is no folder linkList.yes the files have the line package linkList.Should I make a folder linkList and put the files in them?
- 12-14-2009, 09:52 PM #8
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 14,422
- Blog Entries
- 7
- Rep Power
- 29
- 12-14-2009, 09:54 PM #9
Member
- Join Date
- Dec 2009
- Posts
- 9
- Rep Power
- 0
Similar Threads
-
Package Compiling
By kaperks in forum Advanced JavaReplies: 1Last Post: 02-23-2009, 03:56 PM -
JFrame created but window contents not showing, othr threads keep waiting on the user
By FezKazi in forum AWT / SwingReplies: 1Last Post: 02-20-2009, 04:49 PM -
[SOLVED] Compiling Package Class
By nwboy74 in forum New To JavaReplies: 3Last Post: 11-15-2008, 12:19 AM -
Compiling a class in a package from cmd
By Java Tip in forum Java TipReplies: 0Last Post: 12-17-2007, 11:27 AM -
Importing / compiling and running with .jar package
By splinter64uk in forum New To JavaReplies: 1Last Post: 12-05-2007, 03:47 AM
Bookmarks