Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Java > Java and JDK > JSP Basics
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
JSP Basics Beginning-level questions on JSP. More advanced coders should post to Pro JSP.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the JSP Basics section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old January 28th, 2004, 05:02 PM
Registered User
 
Join Date: Jan 2004
Location: , , .
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default 'bad command or file name' error

Hi I'm just starting in java and I have already hit a stumbling block, I have d/loaded and installed J2SE, I have typed the first app in notepad and when I run it in the dos prompt window in the c:\java or the c:\java\bin folder using
javac myfirstapp.java I get a 'bad command or file name' error message
running windows ME. I have searched but do not have a javac.exe file .. this I think is the error, can someone put me out of my misery
cheers Fred
Reply With Quote
  #2 (permalink)  
Old January 28th, 2004, 05:59 PM
Friend of Wrox
 
Join Date: Jun 2003
Location: , , .
Posts: 175
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Javac.exe must exist in the bin folder e.g. j2sdk1.4\bin\javac.exe. If you installed java correctly it must be there. To test that you have insalled Java correctly and set the necessary environment variables, open a commnad prompt and type java - version. This should display information about the version of java that you have installed. If it doesn't, then your install is wrong.

More likely your problem will be that you have not addded c:\j2sdk1.4\bin to the path. If you have already done this then try this: javac "myfirstapp.java".

Let me know how you get on.

Cheers

Martyn
Reply With Quote
  #3 (permalink)  
Old January 28th, 2004, 06:31 PM
Registered User
 
Join Date: Jan 2004
Location: , , .
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Martyn

I don't have the exe file, I have double checked, but the version number does come up - 1.4.2_03
I did add the path into autoexec.bat to point it to my java folder
I'm installing it again via the web so hopefully this time it installs correctly

thanks
fred

Reply With Quote
  #4 (permalink)  
Old January 28th, 2004, 06:42 PM
Friend of Wrox
 
Join Date: Jun 2003
Location: , , .
Posts: 175
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Fred,

The fact that you can determine the version number would infere that Java is installed OK. Have you done a search and located java.exe? Java.exe and javac.exe both reside in the same folder. Find one and you find the other. What objects do you have in the bin folder?

Cheers

Martyn
Reply With Quote
  #5 (permalink)  
Old January 28th, 2004, 06:55 PM
Registered User
 
Join Date: Jan 2004
Location: , , .
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Martyn

I have java.exe and javaw.exe but not javac.exe
I have a total of 58 objects in the bin

thanks

FRed

Reply With Quote
  #6 (permalink)  
Old January 29th, 2004, 05:28 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: , , .
Posts: 175
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Fred,

You somehow appear to have a corrupt installation. My version of C:\j2sdk1.4.2_03\bin has only 28 objects in it! Your best bet would be to uninstall java, visit the Sun site and download the latest version of java and redo the installation.

Let me know how you get on.

By-the-way, there is a known issue with installing the java jre on Windows XP with service pack 1 and certain hotfixes applied. Java will still install but may stall at the end of installation, when it tries to install the plugin. If you have this problem let me know, as I have a couple of work-arounds.

Cheers

Martyn
Reply With Quote
  #7 (permalink)  
Old April 16th, 2004, 06:58 PM
Registered User
 
Join Date: Apr 2004
Location: Beltsville, MD, USA.
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to anathemadevice
Default

I think I know what you problem is...when I first installed Java I got the same error as you. Basically you have to set the path in DOS to where the javac file is located otherwise DOS doesn't recognize it as a valid command. The link below explains exactly how to do this. Hope it helps you or anyone else having the same problem.

http://www.cs.colostate.edu/helpdocs/JavaPaths.html

-Mo



Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Command to get output in a file dved XSLT 1 January 21st, 2008 01:12 PM
Command Button event WMV File C.W. Clark Excel VBA 2 August 7th, 2006 09:36 AM
Bad Data Error chiefg General .NET 1 March 4th, 2006 03:09 AM
How to enable print command in the File Menu? wslstarnite BOOK: Beginning Visual C++ 6 1 August 30th, 2004 01:19 PM
loading a structured file in to db by command rameshkondru SQL Server DTS 0 February 3rd, 2004 07:37 AM



All times are GMT -4. The time now is 12:44 AM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.