Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

Cant Run Java Applications in Textpad

  • 05-10-2010 7:41pm
    #1
    Registered Users, Registered Users 2 Posts: 266 ✭✭


    Hi I am new to Java and I am trying to get Textpad to Run Java Applications on my machine. I have installed the latest JDK prior to installing Textpad.
    I have managed to get Textpad to compile by going to Config>Preferences>Tools>Add and adding javac from the JDK>bin folder.

    When I click on Config>Preferences>Tools>Add and go to the JDK>bin folder and add java.exe it still does not run my compiled applications.

    I have a 64bit Win 7 system and I have tried both versions of JDK(32bit & 64bit)

    Any Help wit this would be greatly appreciated.


Comments

  • Registered Users, Registered Users 2 Posts: 35 Lexor


    First of all, can you compile a java source file from the command line?

    Try to compile a program from the command line before you jump into textpad. At least if you get the program to compile from the command line, then you will know exactly that the problem lies within the textpad environment.

    If you can't compile a java program from the command line, then can you post back a copy of your CLASSPATH, JAVA_HOME and PATH environment variables.
    Type "echo %classpath" from the command line, and replace the classpath with JAVA_HOME and PATH. Also, post back the name of your working directory.

    After this we will know where everything sits and we should be able to fix your problem quite easily.


  • Registered Users, Registered Users 2 Posts: 266 ✭✭Gerb68


    Thanx for the reply.

    No I can't compile a java program from the command line.
    My attached image is what I get when I compile.

    Under System variables in environment variables.....
    CLASSPATH and JAVA_HOME are not displayed as variables.
    The PATH variable has a value of C:\Program Files (x86)\PC Connectivity Solution\;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\

    When I enter ECHO %classpath% in command line I get C:\Program Files (x86)\Java\jdk1.6.0_21\bin
    When I enter ECHO %JAVA_HOME% in command line I get %JAVA_HOME%


    The Directory I'm working from is C:\Users\Gerard\Desktop\JAVA

    Hope this helps


  • Registered Users, Registered Users 2 Posts: 35 Lexor


    The error message your getting (as displayed) in the jpg, is because the directory that contains javac.exe is not in your %path% environment variable (and you are trying to run javac.exe from outside that directory).

    First of all, you will need to amend your PATH environment variable so that the directory that contains javac.exe is included in it. From the command line
    try:

    set PATH=%PATH%;C:\Program Files\Java\jdk1.6.0_21\bin

    Where C:\Program Files\Java\jdk1.6.0_21\bin (on my machine at least) is the directory with the javac.exe program in it. You may need to change the directory name for your own needs. If you have setup your PATH envirnment variable properly, you should be able to invoke javac from any directory on your machine. No point continuing until you get this right.

    After that, you will need to setup your classpath. From the command line, type:

    set CLASSPAPATH=.;

    This dot in your classpath includes the current working directory into your classpath.

    After that you should be home and dry. Forget about the JAVA_HOME environment variable. It is only required by Tomcat. (It's been a while since I did any java work).

    Hope that helps, but if it still doesn't work, post your error reports and we'll take it from there.


  • Registered Users, Registered Users 2 Posts: 14,378 ✭✭✭✭jimmycrackcorm


    For permanency go the the control panel -> system ->advanced -> environment variables -> system variables and add it to the path there so it will always be set.


  • Registered Users, Registered Users 2 Posts: 266 ✭✭Gerb68


    For permanency go the the control panel -> system ->advanced -> environment variables -> system variables and add it to the path there so it will always be set.

    Do I do this for Classpath and edit Path.

    for CLASSPAPATH=.; which is the Variable name and which is the value.


  • Advertisement
  • Registered Users, Registered Users 2 Posts: 35 Lexor


    At the command line in a DOS box, type:

    set PATH=%PATH%;C:\Program Files\Java\jdk1.6.0_21\bin

    You may have to change the directory to where you own javac.exe resides (Do you know the location of javac.exe on your machine? - you can search for it via windows search or else do a dir /s javac.exe at the root of your drive.)

    After the PATH environment has been type the following at the command line:

    set CLASSPATH=.;

    (I spelt classpath wrong in an earlier post, apologies for that!). Let's know how you get on with that.

    @jimmycrackcorm: your perfectly right, but for the time being, I just trying to get the simplest solution so that the OP can compile java programs.


  • Registered Users, Registered Users 2 Posts: 266 ✭✭Gerb68


    Thanx for all the help but still no option to run java applications.

    Instead I reverted back to Textpad 4.7.3 which works perfectly.

    Thanx again.


Advertisement