James Skene

Greenhorn
+ Follow
since Sep 07, 2011
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by James Skene

Campbell and John,

Since my last post I have been working on some Java tutorials and using the javac command to compile all the files to classes. Looks like the compile issue has be solved.

One thing to note:
- I did restart my command prompt many times. After reading previous comments and listening to your recommendations I knew that this could be a problem. However it took my restarting the OS for the Path and JAVA_HOME variables to take effect.

The version reported using the "java -version" command is returning the correct version of my JDK as well.

Thank you for all your help, I am sure to have more questions and will definitely be coming back. Once I have some knowledge to provide I'll work to repay the help with other newbies.

:beerchug:
13 years ago
Hello John,

In the example above I used the term "shell" in reference to accessing the "javac" command from the command prompt, without any arguments, or file access.

As in (using the command prompt):
C:\>javac

The output after using this command is what I reported above, although I truncated the output for readability.

My question refers to whether this is an expected output, or if I should be expecting another output which is not occurring.

Thanks for your help.
13 years ago
Campbell,

So throughout today I had made the changes that you suggested, however the output from the command line was presenting the same error.

javac is not recognized as an internal or external command, operable program or batch file



However, I restarted the computer after receiving the errror and this has seemed to provide a solution. The test below is the output I now receive from a command prompt "javac" command from the C:\documents and settings\user>javac shell.

Usage: javac <options> <source files>
Where possible options include:
-g Generate all bugging info
-g:none Generate no bugging info
-g:{lines, vars, source} Generate only some bugging info
Etc....



Please let me know if this is the output that I should be receiving.

Thanks for all your help.
13 years ago
Campbell,

OK, so as a first step I understand you are recommending the following.

Moving:
C:\Program files\Java\ containing the following sub-directories:
jdk1.6.0_21
jre6
src

To the following location:
C:\Java

Question: Will this cause any errors due to dependencies?
- Other than obviously I will need to change my Path and JAVA_HOME variable again.

Also I will change:
JAVA_HOME - C:\Program Files\Java\jdk1.6.0_21\
To:
JAVA_HOME - C:\Java\jdk1.6.0_21 (after the files have been moved to the new parent directory, note the '\' removal)

Anything else??
13 years ago
Thank you for your response.

I have followed the advice from the previous recommendation.

1. The javac command returns error since the javac executable path is not recognized by the OS. Correct your java home path to C:\Program Files\Java\jdk1.6.0_21 (remove the \bin)
2. The java command returns a different version because it refers to the java installed which comes along with the OS. I hope you have given your custom path installation as the First variable as you mentioned in the Path. But it might look into C:\Program Files\Java\jdk1.6.0_21\bin\bin based on the java home you have configured.



After making these changes my System Environment Variables are as follows.

NOTE: The "Path" variable supplied is my complete "Path" for reference.

JAVA_HOME - C:\Program Files\Java\jdk1.6.0_21\
Path - %JAVA_HOME%\bin;C:\Python27\;C:\Python27\Scripts;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;C:\Program Files\Intel\DMIX;c:\Program Files\Intel\WiFi\bin\;c:\Program Files\Common Files\Roxio Shared\DLLShared\;c:\Program Files\Common Files\Roxio Shared\10.0\DLLShared\;c:\Program Files\Microsoft SQL Server\90\Tools\binn\;C:\WINDOWS\system32\WindowsPowerShell\v1.0;C:\Program Files\jEdit;C:\Program Files\BillQuick2010\;C:\WINDOWS\system32\WindowsPowerShell\v1.0;c:\Program Files\Microsoft SQL Server\100\Tools\Binn\;c:\Program Files\Microsoft SQL Server\100\DTS\Binn\;C:\Program Files\QuickTime\QTSystem\

After making these changes and running the "java" command I receive the same message as above.

I am unfortunately still receiving
the same error when running the "javac" command.

javac is not recognized as an internal or external command, operable program or batch file



As a side note I am running Windows XP SP3.

If I have made an error somewhere please let me know.

Thanks again.
13 years ago
Hello,

I am a novice to coding and very new to Java. It appears that I am having a similar problem as the user above "Scott Allen". With a few exceptions.

My issue is that when I run the command "javac" from the command prompt I am receiving the same error:
- "javac is not recognized as an internal or external command, operable program or batch file"

After reading the comments from above I have configured my System Variables "Path" and "JAVA_HOME" to match the following:
JAVA_HOME: C:\Program Files\Java\jdk1.6.0_21\bin
Path: %JAVA_HOME%\bin; [First Variable]

There is no "Path" User variable on my computer, although there is a "TEMP" and "TMP" in the User Environment variables.

Currently I have the following Java related software installed:
- C:\Program Files\Java\jre6
- C:\Program Files\Java\jdk1.6.0_21
- C:\Program Files\Sun\JavaDB
- C:\Program Files\Eclipse-jee-galileo-3.5.2

I have confirmed the "javac.exe" is located within the \bin directory of Java\jdk.1.6.0_21

When I send "Java -version" to the command prompt the following is returned:
java version "1.6.0_26"

Immediately I noticed that the version is wrong, but don't know why or what to do.

Below is the output from the command "Java" using the command prompt.

Usage: java [-options] class [args...]
(to execute a class)
or java [-options] -jar jarfile [args...]
(to execute a jar file)

where options include:
-client to select the "client" VM
-server to select the "server" VM
-hotspot is a synonym for the "client" VM [deprecated]
The default VM is client.

-cp <class search path of directories and zip/jar files>
-classpath <class search path of directories and zip/jar files>
A ; separated list of directories, JAR archives,
and ZIP archives to search for class files.
-D<name>=<value>
set a system property
-verbose[:class|gc|jni]
enable verbose output
-version print product version and exit
-version:<value>
require the specified version to run
-showversion print product version and continue
-jre-restrict-search | -jre-no-restrict-search
include/exclude user private JREs in the version search
-? -help print this help message
-X print help on non-standard options
-ea[:<packagename>...|:<classname>]
-enableassertions[:<packagename>...|:<classname>]
enable assertions
-da[:<packagename>...|:<classname>]
-disableassertions[:<packagename>...|:<classname>]
disable assertions
-esa | -enablesystemassertions
enable system assertions
-dsa | -disablesystemassertions
disable system assertions
-agentlib:<libname>[=<options>]
load native agent library <libname>, e.g. -agentlib:hprof
see also, -agentlib:jdwp=help and -agentlib:hprof=help
-agentpath:<pathname>[=<options>]
load native agent library by full pathname
-javaagent:<jarpath>[=<options>]
load Java programming language agent, see java.lang.instrument
-splash:<imagepath>
show splash screen with specified image



Any help you can render would be very appreciated.

Thank you.
13 years ago