File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Beginning Java and the fly likes Note able to run java program, urgent!! Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Note able to run java program, urgent!!" Watch "Note able to run java program, urgent!!" New topic
Author

Note able to run java program, urgent!!

sid alam
Greenhorn

Joined: Dec 01, 2001
Posts: 27
Urgent need help.
I am not able to run my java program. When I type java programName at prompt under windows gives me message below:

D:\sunTutorial>java CardWindow
Registry key 'Software\JavaSoft\Java Runtime Environment\CurrentVersion'
has value '1.3', but '1.2' is required.
my program
When I type
D:\sunTutorial>java -version
Registry key 'Software\JavaSoft\Java Runtime Environment\CurrentVersion'
has value '1.3', but '1.2' is required.
Urgently need to solve problem please help???
Anonymous
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
Just a quick thought, have you ensured the environment variables are set up correctly? HTH
Sal Velinus
Greenhorn

Joined: Mar 05, 2002
Posts: 25
Well, go to the Registry and edit the key. If it doesn't work, change it back.
No idea why you'd get the error in the first place, though.
Doanh Nguyen
Ranch Hand

Joined: Dec 02, 2000
Posts: 45
Originally posted by sid alam:
Urgent need help.
I am not able to run my java program. When I type java programName at prompt under windows gives me message below:

D:\sunTutorial>java CardWindow
Registry key 'Software\JavaSoft\Java Runtime Environment\CurrentVersion'
has value '1.3', but '1.2' is required.
my program
When I type
D:\sunTutorial>java -version
Registry key 'Software\JavaSoft\Java Runtime Environment\CurrentVersion'
has value '1.3', but '1.2' is required.
Urgently need to solve problem please help???

I got the same problem, but ONLY when i use a third party software to edit, compile, and run my java programs. I found two solutions to the problem (by the way, I did try unsuccessfully with setting the register key):
1. Use the DOS command window.
2. Since I like the convenience of the text editor, I wrap the command i.e., >>java HelloWorld<< inside a .BAT file and it works fine with the software.
sid alam
Greenhorn

Joined: Dec 01, 2001
Posts: 27
I have installed many versions of java compilers over a period of time.
I have jdk1.2
jdk1.3.1_02
visualCafe3
I have tried the javac command compiler on the command prompt and it returns with the errors below:
I think the problem is, it is trying to compile with an old jdk 1.1x which is defualt for my IDE (Integrated Development Environmet) VisualCafe so it is not recognising the swing files.
I am pretty certain this is the case since I have been able to compile a non swing program and run it.
I think I need to change the autobatexec.bat file???
But I have fogotten how to do this.
Please help?
I know that you have to give the full address of the javac and java program normally located in the bin directory.
But I do not know where the autoexec.bat file is under Windows XP???
Please help???
Symantec Java! JustInTime Compiler Version 3.10.088(i) for JDK 1.1.x
Copyright (C) 1996-98 Symantec Corporation
WestminsterBank.java:1: Package javax.swing not found in import.
import javax.swing.*;
^
WestminsterBank.java:4: Class javax.swing.BorderFactory not found in import.
import javax.swing.BorderFactory;
^
WestminsterBank.java:5: Class javax.swing.border.Border not found in import.
import javax.swing.border.Border;
^
WestminsterBank.java:9: Superclass JFrame of class WestminsterBank not found.
public class WestminsterBank extends JFrame
^
4 errors
Sal Velinus
Greenhorn

Joined: Mar 05, 2002
Posts: 25
I don't think WinXP has an autoexec.bat file, although you can certainly make one. Autoexec.bat is supposed to run various system stuff at startup.
You might be thinking of classpath, or something else.
One solution would be to uninstall old versions of the software.
Marilyn de Queiroz
Sheriff

Joined: Jul 22, 2000
Posts: 9046
    
  10
Do you have "My Computer"? Right click on the icon, Properties, Advanced, Environment variables, JAVA_HOME ...


JavaBeginnersFaq
"Yesterday is history, tomorrow is a mystery, and today is a gift; that's why they call it the present." Eleanor Roosevelt
sid alam
Greenhorn

Joined: Dec 01, 2001
Posts: 27
>You might be thinking of classpath, or something >else.
Yes I am thinking of class path.
Sorry.

How do I change the class path???

------------------------------------------
seperate question I am not receiving mail replies to my mail box?
I have checked my profile and I think all the correct parameters are checked.
For example to receive e-mail notification.
Sal Velinus
Greenhorn

Joined: Mar 05, 2002
Posts: 25
Classpath is an environmental variable. Setting your classpath depends on what version of Windows you're running. Try Marilyn's advice above, or in Win 2K Pro you can go to Control Panel - System - Advanced - Environment Variables and set System Variables.
W98/95 can set classpath in DOS.
sid alam
Greenhorn

Joined: Dec 01, 2001
Posts: 27
I have edited the autoexec.bat file, here it is:
C:\WINDOWS\COMMAND\DOSKEY
rem - By Windows Setup - LH C:\WINDOWS\COMMAND\MSCDEX /D:MSCD001
SET PATH=C:\WINDOWS;C:\WINDOWS\COMMAND;C:\jdk1.3.1_02\bin;
SET CLASSPATH=.; C:\jdk1.3.1_02\bin;
mode con codepage prepare=((850) C:\WINDOWS\COMMAND\ega.cpi)
mode con codepage select=850
keyb uk,,C:\WINDOWS\COMMAND\keyboard.sys
I still get the same problem when I try to run the program.
D:\java\test>java ButtonDemo
Registry key 'Software\JavaSoft\Java Runtime Environment\CurrentVersion'
has value '1.3', but '1.2' is required.
The files are compiled but it does not run.
Please help!!!
I have tried everything?
Sal Velinus
Greenhorn

Joined: Mar 05, 2002
Posts: 25
I'm not sure this is specifically a classpath problem. That's usually ClassNotFound exceptions. You may have conflicting dll's or registry info. I'd try uninstalling the versions of the sdk you don't use (install on another drive or partition if you need them), an/or re-install the sdk you need.
If you have some type of Registry cleaning program, try that.
Andres Gonzalez
Ranch Hand

Joined: Nov 27, 2001
Posts: 1561
try this useful link
http://java.sun.com/j2se/1.4/install-windows.html
or this one
http://java.sun.com/docs/books/tutorial/getStarted/cupojava/win32.html#2
cheers


I'm not going to be a Rock Star. I'm going to be a LEGEND! --Freddie Mercury
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Note able to run java program, urgent!!