![]() |
|
![]() |
| LinkBack | Thread Tools | Display Modes |
| | #1 (permalink) |
| Senior Member Join Date: Mar 2006 Location: India Age: 25
Posts: 126
Thanks: 0
Thanked 20 Times in 11 Posts
Rep Power: 6 | how to run a class file in java?
__________________ abeetha |
| | |
| | #2 (permalink) |
| shaan Join Date: Feb 2006 Location: India
Posts: 60
Thanks: 0
Thanked 1 Time in 1 Post
Rep Power: 4 | by select the path and then if file is in c it can be done as c:>java classfilenameEdited by: shreenath
__________________ sreenath |
| | |
| | #3 (permalink) |
| Senior Member Join Date: Mar 2006 Location: India Age: 25
Posts: 126
Thanks: 0
Thanked 20 Times in 11 Posts
Rep Power: 6 | thank u very much.
__________________ abeetha |
| | |
| | #4 (permalink) |
| Junior Member Join Date: Apr 2006 Location:
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 4 | do we need to set path or class path .ifyes to which folder we need toset my program says java.lang.NoClassDefFoundError: test1 Exception in thread "main" Output completed (0 sec consumed) - Normal Termination |
| | |
| | #5 (permalink) |
| Super Moderator Join Date: Feb 2006
Posts: 2,379
Blog Entries: 4 Thanks: 118
Thanked 319 Times in 238 Posts
Rep Power: 60 | Hi thesurya, You need to set the classpath to bin & lib directories in your java_home. Thanks, Krishna
__________________ Looking for trainees for a start up company |
| | |
| | #6 (permalink) |
| Junior Member Join Date: Apr 2006 Location:
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 4 | hi sk still the program is giving same message. it is getting compiled. it is saved by its class name where the main method is defined, that main method declaration is also checked. but still the same prob. |
| | |
| | #7 (permalink) |
| Super Moderator Join Date: Feb 2006
Posts: 2,379
Blog Entries: 4 Thanks: 118
Thanked 319 Times in 238 Posts
Rep Power: 60 | Hi thesurya, Can you clearly post the exact steps you are following (including the folder in which each file is located) and the output you are getting. This is will us to debug the issue further. Thanks, Krishna
__________________ Looking for trainees for a start up company |
| | |
| | #8 (permalink) |
| Junior Member Join Date: Apr 2006 Location:
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 4 | 1. class test_example { public static void main(String[] args) { System.out.println("Hello World!"); } } 2.then saving as test_example.java in c:\ 3. open dos then compile by -"javac test_example.java" in the required directory("c:\"). 4.then run by "java test_example"-- now it shpws following error Registry key 'Software\JavaSoft\Java Runtime Environment\CurrentVersion' has value '1.4', but '1.5' is required. Error: could not find java.dll Error: could not find Java 2 Runtime Environment. note- in classpath - the value has been set to C:\j2sdk1.4.2_08\bin |
| | |
| | #9 (permalink) |
| Junior Member Join Date: Apr 2006 Location:
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 4 | inreference to the last query the error is some different and let me say i even have updated my java2 platform from net |
| | |
| | #10 (permalink) |
| Super Moderator Join Date: Feb 2006
Posts: 2,379
Blog Entries: 4 Thanks: 118
Thanked 319 Times in 238 Posts
Rep Power: 60 | I never got this kind of error message. May be if you uninstall and install (not rei-nstallation) Java software, if may help you. It looks to be a windows registry issue. May be some one who has more knowledge in this kind of issues can suggest. Thanks, Krishna
__________________ Looking for trainees for a start up company |
| | |
| | #11 (permalink) |
| Junior Member Join Date: Apr 2006 Location:
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 4 | This is very easy to solve. I have got this several times when I have several different compliers and runtime I have four of them. Open Regedit Click start > run > type regedit then go to the 'Software\JavaSoft\Java Runtime Environment\Current version this must be changed und Local Machine ONLY. Then change the value 1.4 to 1.5 that is it. Vinitha J2ee Developer.
__________________ My friends says I am beautiful. |
| | |
| | #12 (permalink) |
| Junior Member Join Date: Apr 2006 Location:
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 4 | in java runtime environment folder i have two folder for java 1-- 1.4.2_08 2-- 1.5.0_06 under both of these folder i have name&n bsp;&n bsp; type&n bsp; value default  ; REG_SZ value not set Balloon Showm REG_DWORD Ox00000001(1) the above description is geiven i changed the value to 1.4(and tried for 1.5 too).here it is working in command prompt but surprisingly in editplus it is not workiing (i have given the path for javac and java command in tools option) kindly solve this one and can i know what is this registry editor used for . i never came through it |
| | |
| | #13 (permalink) |
| Super Moderator Join Date: Feb 2006
Posts: 2,379
Blog Entries: 4 Thanks: 118
Thanked 319 Times in 238 Posts
Rep Power: 60 | Refer this to get a brief idea about windows registry. http://www.annoyances.org/exec/show/registry Thanks, Krishna Edited by: sk_kireeti
__________________ Looking for trainees for a start up company |
| | |
| | #14 (permalink) |
| Junior Member Join Date: Apr 2006 Location:
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 4 | Specific Editpad issues must be treated with looking at Editpad log. I never worked with Editpad, Javac I do not like. Registry is a Row data of information Used by OS and other softwares. It stores information in the form of Binary values and Keys. Each keys will have a value and a Path. In windows registry main root of Tree are HKEY_LOCAL_MACHINE etc. here down the line you find the java Path KEY and Then you changed value. Very carefull to play with the registry as these information can change the way a software looks. Years before we used to Edit Registry to find viruses ( Still does ). But now we use automated tools to avoid registry errors. If we delete some of the Keys under microsoft windows. and restart the computer ( sorry try to ) your computer will not restart. Complete reinstallation may be needed. So I told you the path and do change that path alone and you must keep a backup of the registry before doing a major change. If you accedently delelte any registry entries. Never restart your computer instead double click the back up and old. System Recovery console also cannot help in some case. when you say not working mean there must be proper error message you must respond with the same other wise the debugging is tougher.[img]smileys/smiley36.gif[/img]
__________________ My friends says I am beautiful. |
| | |
![]() |
| Tags |
| class , file , run |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
| |
| More Interview Questions Here... |