Go Back   CodingForums.com > :: Server side development > Java and JSP

Before you post, read our: Rules & Posting Guidelines

Closed Thread
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 09-04-2008, 01:35 PM   PM User | #16
ess
Regular Coder

 
Join Date: Oct 2006
Location: United Kingdom
Posts: 865
Thanks: 7
Thanked 29 Times in 28 Posts
ess will become famous soon enough
I don't know if this will help at all...but sometime ago...I installed a printer driver for HP LaserJet 1010 on one of my PCs....and some how, it interfered with Sun JDK installation on that machine.

I think the driver used a custom implementation of TomCat server, which caused the problems.

It took me ages to figure out what went wrong...and ended up re-installing JDK and everything worked fine thereafter.

I would try and re-install Sun JDK...in case you've installed a software application that implements its own JVM which might be causing all the problems.
ess is offline  
Old 09-04-2008, 02:47 PM   PM User | #17
brad211987
Regular Coder

 
brad211987's Avatar
 
Join Date: Sep 2005
Location: Ohio
Posts: 631
Thanks: 10
Thanked 50 Times in 50 Posts
brad211987 is an unknown quantity at this point
Thats what I was thinking with the versions....Many programs install their own JDK, but I don't see any in the path variable. Usually they put themselves in your windows path, which really throws things off.(Pointing at you Sybase!)
brad211987 is offline  
Users who have thanked brad211987 for this post:
sorbetti (09-06-2008)
Old 09-04-2008, 06:24 PM   PM User | #18
sorbetti
New to the CF scene

 
Join Date: Aug 2008
Location: Finland
Posts: 9
Thanks: 3
Thanked 0 Times in 0 Posts
sorbetti is an unknown quantity at this point
Here we go again. I reinstalled both JRE and JDK into folder C:\Java and changed the path to point the new installation, and still not working. This is indeed a very strange case. I have a feeling it has something to with Vista, but can not be sure. Test results below, everything looks like normal.


C:\Java\jdk1.6.0_07\bin>javac
Usage: javac <options> <source files>
where possible options include:
-g Generate all debugging info
-g:none Generate no debugging info
-g:{lines,vars,source} Generate only some debugging info
-nowarn Generate no warnings
-verbose Output messages about what the compiler is doing
-deprecation Output source locations where deprecated APIs are used
-classpath <path> Specify where to find user class files and annotation processors
-cp <path> Specify where to find user class files and annotation processors
-sourcepath <path> Specify where to find input source files
-bootclasspath <path> Override location of bootstrap class files
-extdirs <dirs> Override location of installed extensions
-endorseddirs <dirs> Override location of endorsed standards path
-proc:{none,only} Control whether annotation processing and/or compilation is done.
-processor <class1>[,<class2>,<class3>...]Names of the annotation processors to run; bypasses default discovery process
-processorpath <path> Specify where to find annotation processors
-d <directory> Specify where to place generated class files
-s <directory> Specify where to place generated source files
-implicit:{none,class} Specify whether or not to generate class files for implicitly referenced files
-encoding <encoding> Specify character encoding used by source files
-source <release> Provide source compatibility with specified release
-target <release> Generate class files for specific VM version
-version Version information
-help Print a synopsis of standard options
-Akey[=value] Options to pass to annotation processors
-X Print a synopsis of nonstandard options
-J<flag> Pass <flag> directly to the runtime system


C:\>java -version
java version "1.6.0_07"
Java(TM) SE Runtime Environment (build 1.6.0_07-b06)
Java HotSpot(TM) Client VM (build 10.0-b23, mixed mode, sharing)


C:\>set
ALLUSERSPROFILE=C:\ProgramData
APPDATA=C:\Users\Sami\AppData\Roaming
CLASS_PATH=.;
CommonProgramFiles=C:\Program Files\Common Files
COMPUTERNAME=SAMI-PC
ComSpec=C:\Windows\system32\cmd.exe
configsetroot=C:\Windows\ConfigSetRoot
FP_NO_HOST_CHECK=NO
HOMEDRIVE=C:
HOMEPATH=\Users\Sami
LOCALAPPDATA=C:\Users\Sami\AppData\Local
LOGONSERVER=\\SAMI-PC
NUMBER_OF_PROCESSORS=2
OS=Windows_NT
Path=C:\Windows\system32; C:\Windows; C:\Windows\System32\Wbem; C:\Java\jdk1.6.0_07\bin; C:\Program Files\Microsoft SQL Server\90\Tools
\binn\; C:\Program Files\MATLAB\R2008a\bin; C:\Program Files\MATLAB\R2008a\bin\win32; C:\Program Files\SSH Communications Security\SS
H Tectia\SSH Tectia AUX; C:\Program Files\SSH Communications Security\SSH Tectia\SSH Tectia AUX\Support binaries; C:\Program Files\SSH
Communications Security\SSH Tectia\SSH Tectia Broker; C:\Program Files\SSH Communications Security\SSH Tectia\SSH Tectia Client; C:\Pro
gram Files\jprofiler5\bin\windows;
PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC
PROCESSOR_ARCHITECTURE=x86
PROCESSOR_IDENTIFIER=x86 Family 6 Model 15 Stepping 10, GenuineIntel
PROCESSOR_LEVEL=6
PROCESSOR_REVISION=0f0a
ProgramData=C:\ProgramData
ProgramFiles=C:\Program Files
PROMPT=$P$G
PUBLIC=C:\Users\Public
SESSIONNAME=Console
SystemDrive=C:
SystemRoot=C:\Windows
TEMP=C:\Users\Sami\AppData\Local\Temp
TMP=C:\Users\Sami\AppData\Local\Temp
USERDOMAIN=Sami-PC
USERNAME=Sami
USERPROFILE=C:\Users\Sami
VS90COMNTOOLS=C:\Program Files\Microsoft Visual Studio 9.0\Common7\Tools\
windir=C:\Windows
sorbetti is offline  
Old 09-04-2008, 06:38 PM   PM User | #19
sorbetti
New to the CF scene

 
Join Date: Aug 2008
Location: Finland
Posts: 9
Thanks: 3
Thanked 0 Times in 0 Posts
sorbetti is an unknown quantity at this point
Oh, I just noticed the second page of this thread Maybe it indeed is some other program that is messing the Java installation, but that will definitely take ages to find it out as I have dozens of programs installed. Maybe I just have to stick with IDE's until that. But if you get an idea what might be the problem or if you notice something wrong with my settings, please let me know...
sorbetti is offline  
Old 09-04-2008, 09:30 PM   PM User | #20
brad211987
Regular Coder

 
brad211987's Avatar
 
Join Date: Sep 2005
Location: Ohio
Posts: 631
Thanks: 10
Thanked 50 Times in 50 Posts
brad211987 is an unknown quantity at this point
It looks like its working fine now....

The javac command gave you the usage instructions just as it should.
brad211987 is offline  
Old 09-05-2008, 04:04 PM   PM User | #21
_Aerospace_Eng_
Supreme Master coder!


 
_Aerospace_Eng_'s Avatar
 
Join Date: Dec 2004
Location: In a place far, far away...
Posts: 19,293
Thanks: 2
Thanked 1,044 Times in 1,020 Posts
_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light
This is what is in my PATH now in Vista Ultimate. It seems work just fine.
Code:
%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;C:\Program Files\Java\jdk1.6.0_07\bin;
You may have PATHs in yours.

For future reference this tells you what you need to do. Its the same concept on Vista: http://java.sun.com/javase/6/webnote...ml#Environment

Also as stated your installation appears to be working fine. Now you just need to use
Code:
javac yourfilename.java
__________________
||||If you are getting paid to do a job, don't ask for help on it!||||
_Aerospace_Eng_ is offline  
Users who have thanked _Aerospace_Eng_ for this post:
sorbetti (09-06-2008)
Old 09-05-2008, 05:23 PM   PM User | #22
sorbetti
New to the CF scene

 
Join Date: Aug 2008
Location: Finland
Posts: 9
Thanks: 3
Thanked 0 Times in 0 Posts
sorbetti is an unknown quantity at this point
Quote:
Originally Posted by brad211987 View Post
It looks like its working fine now....

The javac command gave you the usage instructions just as it should.
Not really! It works as it should only in Java installation directory. When I try to use javac in ANY other directory, I get an error message "javac is not recognized as an internal or external command etc". So the original problem still exists. It was just a test suggested by ess in the previous message to find out whether or not javac works at all...
sorbetti is offline  
Old 09-05-2008, 06:45 PM   PM User | #23
ess
Regular Coder

 
Join Date: Oct 2006
Location: United Kingdom
Posts: 865
Thanks: 7
Thanked 29 Times in 28 Posts
ess will become famous soon enough
Not sure if this is going to help you at all...but when I went through the beta testing of Windows Vista before it was released, I experienced the same problems that you've described above...where my JDK installation didn't work even when the path variable was set correctly.

Not that I am implying that you don't have a legitimate copy...but wondered if you need to update Vista and apply all the latest patches such as Windows Vista SP1 etc.

Furthermore, you need to ensure that you download and install the correct JDK for your system. In other words, if your system is x64 based, you should download and install the JDK x64 release and not the i586 release.

Last edited by ess; 09-05-2008 at 06:49 PM..
ess is offline  
Users who have thanked ess for this post:
sorbetti (09-06-2008)
Old 09-05-2008, 06:59 PM   PM User | #24
_Aerospace_Eng_
Supreme Master coder!


 
_Aerospace_Eng_'s Avatar
 
Join Date: Dec 2004
Location: In a place far, far away...
Posts: 19,293
Thanks: 2
Thanked 1,044 Times in 1,020 Posts
_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light
I am using Vista Ultimate SP1 and javac works in any directory I am in. Attached is a screenshot.

__________________
||||If you are getting paid to do a job, don't ask for help on it!||||
_Aerospace_Eng_ is offline  
Old 09-05-2008, 08:47 PM   PM User | #25
sorbetti
New to the CF scene

 
Join Date: Aug 2008
Location: Finland
Posts: 9
Thanks: 3
Thanked 0 Times in 0 Posts
sorbetti is an unknown quantity at this point
I have a 32-bit system and the correct JDK is installed. I also have SP1 and all the latest updates installed, as I have Vista's autoupdate on. Like I mentioned earlier, in my XP machine everything works just fine, like in the previous message's screenshot. Like also mentioned before, this seems to be a very strange case, and only explanation I can figure out, is that some other program is messing up the JDK installation, since all the basic settings seems to be in order.
sorbetti is offline  
Old 09-15-2008, 03:46 PM   PM User | #26
moporho
New to the CF scene

 
Join Date: Sep 2008
Location: Fort Lauderdale, FL
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
moporho is an unknown quantity at this point
Followed Advice, but Still Not Working

I have followed the above advice, but I can not get past

javac Hello.java

Code:
C:\Users\moporho>javac Hello.java
javac: file not found: Hello.java
Usage: javac <options> <source files>
use -help for a list of possible options

C:\Users\moporho>java Hello.java
Exception in thread "main" java.lang.NoClassDefFoundError: Hello/java
Caused by: java.lang.ClassNotFoundException: Hello.java
        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)


Here is set

Code:
Microsoft Windows [Version 6.0.6001]
Copyright (c) 2006 Microsoft Corporation.  All rights reserved.

C:\Users\moporho>java -version
java version "1.6.0_07"
Java(TM) SE Runtime Environment (build 1.6.0_07-b06)
Java HotSpot(TM) Client VM (build 10.0-b23, mixed mode, sharing)

c:\>set
ALLUSERSPROFILE=C:\ProgramData
APPDATA=C:\Users\moporho\AppData\Roaming
CLASSPATH=.;
CommonProgramFiles=C:\Program Files\Common Files
COMPUTERNAME=MOPORHO-PC
ComSpec=C:\Windows\system32\cmd.exe
FP_NO_HOST_CHECK=NO
HOMEDRIVE=C:
HOMEPATH=\Users\moporho
JAVA_HOME=C:\jdk1.6.0_07\bin;
LOCALAPPDATA=C:\Users\moporho\AppData\Local
LOGONSERVER=\\MOPORHO-PC
NUMBER_OF_PROCESSORS=2
OS=Windows_NT
Path=C:\oraclexe\app\oracle\product\10.2.0\server\bin;C:\Windows\system32;C:\Win
dows;C:\Windows\System32\Wbem;C:\Program Files\Intel\DMIX;C:\Program Files\ATI T
echnologies\ATI.ACE\Core-Static;C:\Program Files\Common Files\Roxio Shared\DLLSh
ared\;C:\Program Files\Common Files\Roxio Shared\10.0\DLLShared\;C:\Program File
s\QuickTime\QTSystem\;C:\jdk1.6.0_07\bin;
PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC
PROCESSOR_ARCHITECTURE=x86
PROCESSOR_IDENTIFIER=x86 Family 6 Model 15 Stepping 11, GenuineIntel
PROCESSOR_LEVEL=6
PROCESSOR_REVISION=0f0b
ProgramData=C:\ProgramData
ProgramFiles=C:\Program Files
PROMPT=$P$G
PUBLIC=C:\Users\Public
QTJAVA=C:\Program Files\Java\jre1.6.0\lib\ext\QTJava.zip
RoxioCentral=C:\Program Files\Common Files\Roxio Shared\10.0\Roxio Central36\
SESSIONNAME=Console
SystemDrive=C:
SystemRoot=C:\Windows
TEMP=C:\Users\moporho\AppData\Local\Temp
TMP=C:\Users\moporho\AppData\Local\Temp
USERDOMAIN=moporho-PC
USERNAME=moporho
USERPROFILE=C:\Users\moporho
VS80COMNTOOLS=C:\Program Files\Microsoft Visual Studio 8\Common7\Tools\
windir=C:\Windows
Can someone please help as I am going crazy??

Cheers,
MoPoRho
moporho is offline  
Old 09-15-2008, 05:29 PM   PM User | #27
moporho
New to the CF scene

 
Join Date: Sep 2008
Location: Fort Lauderdale, FL
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
moporho is an unknown quantity at this point
I tried it over again and IT WORKED!!!! Thanks Ess!
moporho is offline  
Old 10-13-2008, 08:54 PM   PM User | #28
mullmo928
New to the CF scene

 
Join Date: Oct 2008
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
mullmo928 is an unknown quantity at this point
Thanks

Just to say thanks. Had a simulator ok on XP that failed on Vista.
OK now


Quote:
Originally Posted by ess View Post
Please follow these steps...

1- Right Click on My Computer on your desktop and click on Properties
2- Computer Properties Window will open....Click on Advanced System Settings
3- Click ok when the stupid administrator window appears (Personally I have disabled them...as I find them annoying and pointless)
4- Click on Environment Variables
5- Under the Systems Variables, click the NEW button to create a new Variable
6- Enter the following inside the dialog
Variable Name: JAVA_HOME
Variable Value: FOLDER_CONTAINING_JAVA_INSTALLATION for example C:\Program Files\Java\jdk1.6.0_02
7- Inside the Systems Variables, locate the Path entry. Select it...then click on the edit button
8- At the end of the PATH, enter a semi column if there is NOT one there already
9- At the end of the PATH variable, enter %JAVA_HOME%\bin;

Click on Apply and ok buttons to close all opened dialogs

Start a new (if you have one opened already...it won't work) prompt or MS Dos command prompt and type the following

Code:
java -version
You should see details of the installed version of Java etc. once you hit the RETURN key

Within the command prompt, type the following

Code:
notepad Hello.java
Paste the following inside it

Code:
public class Hello { 
   public static void main(String [] args) { 
      System.out.println("Hello World ;)");
   }
}
save the file and exit notepad

at the command prompt type the following

Code:
javac Hello.java
If no errors are generated, type the following

Code:
java Hello
Cheers
~E
mullmo928 is offline  
Old 02-06-2009, 02:37 AM   PM User | #29
Aradon
Moderator-san


 
Aradon's Avatar
 
Join Date: Jun 2005
Location: USA
Posts: 734
Thanks: 0
Thanked 20 Times in 19 Posts
Aradon is on a distinguished road
To prevent Necro-posting I am locking this thread, however it will be added to the Sticky as threads that are interesting / frequently asked.
__________________
"To iterate is human, to recurse divine." -L. Peter Deutsch
Aradon is offline  
Closed Thread

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

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 On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 09:37 AM.


Advertisement
Log in to turn off these ads.