473,657 Members | 2,953 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Need help with SDK

Hello

I've downloaded the Java SDK 1.4.0 from Sun's website in the hope to
learning Java, however when I compile my *.java files this (at most times)
works fine, however when I run the *.class file using java.exe I get this
error message.

D:\jdk1.3\bin>j ava FirstLine.class

Exception in thread "main" java.lang.NoCla ssDefFoundError : FirstLine/class

I'm using Windows XP Pro with Java Runtime 1.4.0.
Can anyone help me? Any help would be great.
Thanks
Jul 17 '05 #1
4 2411
Allan,

Newbie mistake #23: The argument to the Java launcher (the "java"
command) takes _class_ names, not class _file_ names as arguments.

By including the ".class" suffix you instructd the Java launcher to
invoke the "main" entry point in the class named "FirstLine.clas s"
while I'm sure the class you wrote is called simply "FirstLine" .

Also, get the latest J2SDK, which is now 1.4.2. Bugs are routinely
fixed, performance improved and library API enhancements added.

Similar complaints ("java.lang.NoC lassDefFoundErr or" can result from
class-path and package naming problems. Be sure you understand these
concepts and the java launcher options and environment variables that
pertain to locating class files.

Good luck.

Randall Schulz
Allan Robertson wrote:
Hello

I've downloaded the Java SDK 1.4.0 from Sun's website in the hope
to learning Java, however when I compile my *.java files this (at
most times) works fine, however when I run the *.class file using
java.exe I get this error message.

D:\jdk1.3\bin>j ava FirstLine.class

Exception in thread "main" java.lang.NoCla ssDefFoundError :
FirstLine/class

I'm using Windows XP Pro with Java Runtime 1.4.0. Can anyone help
me? Any help would be great.

Thanks


Jul 17 '05 #2
Phil,

There is a convention in the Sun Java tools to map package nesting
structures (with package names separated by dots, of course) to
directories separated by slashes. That's what you're seeing in that
exception diagnostic.

Randall Schulz
Phil... wrote:
A minor tweak on your otherwise excellent explanation. Note the
error message says FirstLine/class It thinks the dot means to go to
a subdirectory similar to what is done with import statements.


Jul 17 '05 #3
Thanks for your help, the code compiles fine now. I took your advice and
downloaded the 1.4.2_01 SDK fron Sun. Thanks :)

"Randall R Schulz" <rr******@cris. com> wrote in message
news:RG******** ************@ty phoon.sonic.net ...
Allan,

Newbie mistake #23: The argument to the Java launcher (the "java"
command) takes _class_ names, not class _file_ names as arguments.

By including the ".class" suffix you instructd the Java launcher to
invoke the "main" entry point in the class named "FirstLine.clas s"
while I'm sure the class you wrote is called simply "FirstLine" .

Also, get the latest J2SDK, which is now 1.4.2. Bugs are routinely
fixed, performance improved and library API enhancements added.

Similar complaints ("java.lang.NoC lassDefFoundErr or" can result from
class-path and package naming problems. Be sure you understand these
concepts and the java launcher options and environment variables that
pertain to locating class files.

Good luck.

Randall Schulz
Allan Robertson wrote:
Hello

I've downloaded the Java SDK 1.4.0 from Sun's website in the hope
to learning Java, however when I compile my *.java files this (at
most times) works fine, however when I run the *.class file using
java.exe I get this error message.

D:\jdk1.3\bin>j ava FirstLine.class

Exception in thread "main" java.lang.NoCla ssDefFoundError :
FirstLine/class

I'm using Windows XP Pro with Java Runtime 1.4.0. Can anyone help
me? Any help would be great.

Thanks

Jul 17 '05 #4
Have you added '.\' to the CLASSPATH variable
add the line
SET CLASSPATH=.';%C LASSPATH%
in your c:\autoexec.bat
HTH
Saurabh
"Allan Robertson" <no****@nospam. com> wrote in message
news:xj******** ******@news-binary.blueyond er.co.uk...
Hello

I've downloaded the Java SDK 1.4.0 from Sun's website in the hope to
learning Java, however when I compile my *.java files this (at most times)
works fine, however when I run the *.class file using java.exe I get this
error message.

D:\jdk1.3\bin>j ava FirstLine.class

Exception in thread "main" java.lang.NoCla ssDefFoundError : FirstLine/class

I'm using Windows XP Pro with Java Runtime 1.4.0.
Can anyone help me? Any help would be great.
Thanks

Jul 17 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
2433
by: Sofia | last post by:
My name is Sofia and I have for many years been running a personals site, together with my partner, on a non-profit basis. The site is currently not running due to us emigrating, but during its last year we got traffic of between 2000 - 2500 unique visitors per day. We are now about to re-launch the site from Sweden and we need to purchase a script to run it. Having looked at what is available on the net I have realised that we need a...
7
4384
by: Mike Kamermans | last post by:
I hope someone can help me, because what I'm going through at the moment trying to edit XML documents is enough to make me want to never edit XML again. I'm looking for an XML editor that has a few features that you'd expect in any editor, except nearly none of them seem to have: 1 - Search and repalce with Regular Expressions. 2 - Search and Replace in an Xpath context. 3 - User specified tag-generation for either on a...
15
3673
by: drdoubt | last post by:
using namespace std In my C++ program, even after applying , I need to use the std namespace with the scope resolution operator, like, std::cout, std::vector. This I found a little bit cumbersome to always include std. I somewhere found a trick to overcome this problem. By using using std::cout;
9
2921
by: sk | last post by:
I have an applicaton in which I collect data for different parameters for a set of devices. The data are entered into a single table, each set of name, value pairs time-stamped and associated with a device. The definition of the table is as follows: CREATE TABLE devicedata ( device_id int NOT NULL REFERENCES devices(id), -- id in the device
3
2622
by: Bob.Henkel | last post by:
I write this to tell you why we won't use postgresql even though we wish we could at a large company. Don't get me wrong I love postgresql in many ways and for many reasons , but fact is fact. If you need more detail I can be glad to prove all my points. Our goal is to make logical systems. We don't want php,perl, or c++ making all the procedure calls and having the host language to be checking for errors and handleing all the...
3
10638
by: google | last post by:
I have a database with four table. In one of the tables, I use about five lookup fields to get populate their dropdown list. I have read that lookup fields are really bad and may cause problems that are hard to find. The main problem I am having right now is that I have a report that is sorted by one of these lookup fields and it only displays the record's ID number. When I add the source table to the query it makes several records...
4
7394
by: Phil | last post by:
k, here is my issue.. I have BLOB data in SQL that needs to be grabbed and made into a TIF file and placed on the client (could be in temp internet dir). The reason we need it in TIF format is there are multiple pages per invoice. How can I grab the data, make the TIF, place it on the client and then Open with the clients default program for veiwing TIF's (usually Microsoft Picture and Fax Viewer). Please help.
8
1828
by: Sai Kit Tong | last post by:
In the article, the description for "Modiy DLL That Contains Consumers That Use Managed Code and DLL Exports or Managed Entry Points" suggests the creation of the class ManagedWrapper. If I need to build multiple mixed mode dll's used by a consumer application, do I have to implement multiple ManagedWrapper's (each embedded in indiviudal DLL project) and call all of them in my consumer application?
2
1946
by: Michael R. Pierotti | last post by:
Dim reg As New Regex("^\d{1,3}.\d{1,3}.\d{1,3}.\d{1,3}$") Dim m As Match = reg.Match(txtIPAddress.Text) If m.Success Then 'No need to do anything here Else MessageBox.Show("You need to enter a valid IP Address", "Error!", MessageBoxButtons.OK, MessageBoxIcon.Hand) txtIPAddress.Focus() Return End If
0
3945
by: U S Contractors Offering Service A Non-profit | last post by:
Brilliant technology helping those most in need Inbox Reply U S Contractors Offering Service A Non-profit show details 10:37 pm (1 hour ago) Brilliant technology helping those most in need Inbox Reply from Craig Somerford <uscos@2barter.net> hide details 10:25 pm (3 minutes ago)
0
8384
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8302
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8718
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8601
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7314
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6162
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5630
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
2726
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1937
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.