Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 07-08-2009, 06:34 AM
Kaz Kaz is offline
Member
 
Join Date: Jun 2009
Posts: 6
Rep Power: 0
Kaz is on a distinguished road
Default An unfixable problem (very newb)
I am trying to run a java-based program. It required JDK. I have installed the latest version of JDK. I have edited my environmental variables appropriately. Still, when I run the program I get an error saying JDK isn't installed. I have some pictures to give you all the information you may need to help me out here.

NOTE: These are links, just copy and paste.

The Program (batch file) I am trying to run. It basically is supposed to launch a client, there are other files in the same folder, I don't think it's the program though.
i28.tinypic.com/27yzxi1.jpg

The Error:
i29.tinypic.com/2vbokk4.jpg

The Location of my JDK:
i30.tinypic.com/25jibsp.jpg

My Environmental Variable PATH:
i26.tinypic.com/15rxt9c.jpg

Please, tell me if I have done something wrong. I have searched the internet for MONTHS, reading the posts by people with the same problem, the answers, I went to java's troubleshooting, tutorial, the list of what I have done to fix this problem is endless. PLEASE If you can help me, I will be VERY VERY grateful, thank you.
Bookmark Post in Technorati
Reply With Quote
  #2 (permalink)  
Old 07-08-2009, 07:13 AM
Senior Member
 
Join Date: Dec 2008
Location: Hong Kong
Posts: 473
Rep Power: 2
mtyoung is on a distinguished road
Default
may be you try to modify program file to progra~1 in the path of environmental variable
Bookmark Post in Technorati
Reply With Quote
  #3 (permalink)  
Old 07-08-2009, 07:38 AM
Kaz Kaz is offline
Member
 
Join Date: Jun 2009
Posts: 6
Rep Power: 0
Kaz is on a distinguished road
Default
I'm not too sure what exactly that'd involve, I know nothing about java or programming, and only a little bit about computers in general, you'd have to give me a pretty step-by-step run down.

ALSO: I found THIS in the folder of the program, my common sense tells me its what is used to find my JDK, it is a batch file. Perhaps something in here just doesn't line up with my computer properly? It might have something to do with my C drive being labeled H:\ or something, I have been told that before. Thanks,

i30.tinypic.com/2i7wsjc.gif
Bookmark Post in Technorati
Reply With Quote
  #4 (permalink)  
Old 07-08-2009, 09:28 AM
angryboy's Avatar
Senior Member
 
Join Date: Jan 2009
Location: Javaland
Posts: 743
Rep Power: 2
angryboy is on a distinguished road
Default
is your c:\ in use? is there a drive call "C"?
Also, can you post the "compile.bat" file. maybe we can change something there.
__________________
USE CODE TAGS--> [CODE]...[/CODE]
Get NotePad++ (free)

Last edited by angryboy; 07-08-2009 at 09:45 AM.
Bookmark Post in Technorati
Reply With Quote
  #5 (permalink)  
Old 07-08-2009, 08:58 PM
Kaz Kaz is offline
Member
 
Join Date: Jun 2009
Posts: 6
Rep Power: 0
Kaz is on a distinguished road
Default
Code:
@ECHO OFF

CALL FindJDK.bat

SET cc=javac
SET cflags=-nowarn -Xlint:deprecation -Xlint:none
SET out=out
SET bin=rs.jar
SET quiet=0

IF "%1"=="/Q" SET quiet=1
IF "%1"=="/F" (
	SET quiet=1
	GOTO :scripts
)

ECHO Compiling Bot
SET lstf=_jlist.txt
IF EXIST %lstf% DEL /F /Q %lstf%
FOR /F "usebackq tokens=*" %%G IN (`DIR /B /S Bot\*.java`) DO CALL :append "%%G"
IF EXIST %out% RMDIR /S /Q %out% >NUL
MKDIR %out%
%cc% %cflags% -cp %bin% -d %out% "@%lstf%"
DEL /F /Q "%lstf%"

CALL :compset Randoms
CALL :compset AntiBan

:scripts
CALL :compset Scripts
XCOPY /B /Y Scripts\Precompiled\*.class Scripts\*.class 2>NUL

ECHO Compilation successful, click play or play-free to start!
IF "%quiet%"=="0" PAUSE
GOTO :eof

:append
SET gx=%1
SET gx=%gx:\=\\%
ECHO %gx% >> %lstf%
GOTO :eof

:compset
ECHO Compiling %1
ECHO. > %1\.class
DEL /F /Q %1\*.class > NUL
%cc% %cflags% -cp "%out%;%bin%" %1\*.java > NUL
GOTO :eof
That's the compile.bat file.
And no, my C drive is not in use. I would however like to change my drive to C:\, but apparently you are not allowed.
Bookmark Post in Technorati
Reply With Quote
  #6 (permalink)  
Old 07-09-2009, 02:28 AM
angryboy's Avatar
Senior Member
 
Join Date: Jan 2009
Location: Javaland
Posts: 743
Rep Power: 2
angryboy is on a distinguished road
Default
This file calls another batch file named "FindJDK.bat". Can you post that as well? It maybe the source of your problem.

Since your c: is not in use, there is a way to create a temp alias. Open a command prompt and type:
Code:
H:\> subst c: h:\

H:\> subst
C:\: => H:\

H:\> javac -version
javac 1.6.0

H:\> _
Offcourse, this is only temp, so it will not stay when the comp is rebooted.

Then, if still not working, try changing all references in the PATH and CLASSPATH from H:\program file\jdk.... to c:\.....
__________________
USE CODE TAGS--> [CODE]...[/CODE]
Get NotePad++ (free)
Bookmark Post in Technorati
Reply With Quote
  #7 (permalink)  
Old 07-09-2009, 03:13 AM
Kaz Kaz is offline
Member
 
Join Date: Jun 2009
Posts: 6
Rep Power: 0
Kaz is on a distinguished road
Default
When trying to use your command, it said "subst" isn't a command. Also, here is the FindJDK.bat Thanks for your help

Code:
@ECHO OFF

ECHO Looking for JDK

SET KEY_NAME=HKLM\SOFTWARE\JavaSoft\Java Development Kit
FOR /F "tokens=3" %%A IN ('REG QUERY "%KEY_NAME%" /v CurrentVersion 2^>NUL') DO SET jdkv=%%A
SET jdk=

IF DEFINED jdkv (
	FOR /F "skip=2 tokens=3,4" %%A IN ('REG QUERY "%KEY_NAME%\%jdkv%" /v JavaHome 2^>NUL') DO SET jdk=%%A %%B
) ELSE (
	FOR /F "tokens=*" %%G IN ('DIR /B "%ProgramFiles%\Java\jdk*"') DO SET jdk=%%G
)

SET jdk=%jdk%\bin
SET javac="%jdk%\javac.exe"

IF NOT EXIST %javac% (
	javac -version 2>NUL
	IF "%ERRORLEVEL%" NEQ "0" GOTO :notfound
) ELSE (
	GOTO :setpath
)
GOTO :eof

:notfound
ECHO JDK is not installed, please download and install it from:
ECHO h t t p : / / j a v a . s u n . c o m / j a v a s e / d o w n l o a d s
ECHO.
PAUSE
EXIT

:setpath
SET PATH=%jdk%;%PATH%
GOTO :eof
Bookmark Post in Technorati
Reply With Quote
  #8 (permalink)  
Old 07-09-2009, 05:19 AM
angryboy's Avatar
Senior Member
 
Join Date: Jan 2009
Location: Javaland
Posts: 743
Rep Power: 2
angryboy is on a distinguished road
Default
This is for FindJDK.bat, make a backup first before you edit the file.

Everything else is the same, I removed stuff and changed the line below in bold. You'll have to change it to your own path, I'm not sure what it is.

Code:
@ECHO OFF

ECHO Looking for JDK

SET KEY_NAME=HKLM\SOFTWARE\JavaSoft\Java Development Kit
FOR /F "tokens=3" %%A IN ('REG QUERY "%KEY_NAME%" /v CurrentVersion 2^>NUL') DO SET jdkv=%%A

SET jdk=C:\Program Files\Java\jdk1.6.0


SET jdk=%jdk%\bin
SET javac="%jdk%\javac.exe"

REM ... everything else is the same from here on.......
Hope it works...

btw, you are using vista?
__________________
USE CODE TAGS--> [CODE]...[/CODE]
Get NotePad++ (free)
Bookmark Post in Technorati
Reply With Quote
  #9 (permalink)  
Old 07-09-2009, 05:49 AM
Kaz Kaz is offline
Member
 
Join Date: Jun 2009
Posts: 6
Rep Power: 0
Kaz is on a distinguished road
Default
You my friend, have fixed my problem! Thank you SO much, I'll hit the rep button for you. I've been at this for MONTHS! FINALLY! And I am using XP Service Pack 3.
Bookmark Post in Technorati
Reply With Quote
Reply

Bookmarks

Thread Tools
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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Another Newb, with some problems. Carrier Introductions 0 04-22-2009 10:26 PM
[SOLVED] Probably a tooootal newb question... but proeliumfessus New To Java 6 04-05-2009 08:07 PM
Help with newb-project much appreciated barr New To Java 7 12-11-2008 12:14 PM
Java newb Q: 8-digit id 1111FM New To Java 2 09-29-2008 03:37 PM
Newb Topics dkizzy New To Java 2 09-17-2008 08:01 AM


All times are GMT +2. The time now is 06:26 PM.



VBulletin, Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2009, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org