Results 1 to 9 of 9
  1. #1
    Kaz
    Kaz is offline Member
    Join Date
    Jun 2009
    Posts
    6
    Rep Power
    0

    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.

  2. #2
    mtyoung is offline Senior Member
    Join Date
    Dec 2008
    Location
    Hong Kong
    Posts
    473
    Rep Power
    6

    Default

    may be you try to modify program file to progra~1 in the path of environmental variable

  3. #3
    Kaz
    Kaz is offline Member
    Join Date
    Jun 2009
    Posts
    6
    Rep Power
    0

    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

  4. #4
    angryboy's Avatar
    angryboy is offline Senior Member
    Join Date
    Jan 2009
    Posts
    742
    Rep Power
    6

    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.
    Last edited by angryboy; 07-08-2009 at 09:45 AM.
    USE CODE TAGS--> [CODE]...[/CODE]
    Get NotePad++ (free)

  5. #5
    Kaz
    Kaz is offline Member
    Join Date
    Jun 2009
    Posts
    6
    Rep Power
    0

    Default

    Java 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.

  6. #6
    angryboy's Avatar
    angryboy is offline Senior Member
    Join Date
    Jan 2009
    Posts
    742
    Rep Power
    6

    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:
    Java 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)

  7. #7
    Kaz
    Kaz is offline Member
    Join Date
    Jun 2009
    Posts
    6
    Rep Power
    0

    Default

    When trying to use your command, it said "subst" isn't a command. Also, here is the FindJDK.bat Thanks for your help :)

    Java 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

  8. #8
    angryboy's Avatar
    angryboy is offline Senior Member
    Join Date
    Jan 2009
    Posts
    742
    Rep Power
    6

    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.

    Java 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=[B]C:\Program Files\Java\jdk1.6.0[/B]
    
    
    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)

  9. #9
    Kaz
    Kaz is offline Member
    Join Date
    Jun 2009
    Posts
    6
    Rep Power
    0

    Default

    You my friend, have fixed my problem! :D 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.

Similar Threads

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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •