Reputation: 1
I am attempting to get java set up on my PC and I am having issues. I believe these issues are related to configuring the path correctly.
Currently if I run java in my cmd line, I get the following:
Usage: java [-options] class [args...] (to execute a class) or java [-options] -jar jarfile [args...] (to execute a jar file) where options include: -d32 use a 32-bit data model if available -d64 use a 64-bit data model if available -client to select the "client" VM -server to select the "server" VM 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>
Warning: this feature is deprecated and will be removed
in a future release.
require the specified version to run
-showversion print product version and continue
-jre-restrict-search | -no-jre-restrict-search
Warning: this feature is deprecated and will be removed
in a future release.
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 with specified granularity
-da[:<packagename>...|:<classname>]
-disableassertions[:<packagename>...|:<classname>]
disable assertions with specified granularity
-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
See http://www.oracle.com/technetwork/java/javase/documentation/index.html for more details.
However, when I try and run javac, I get the following:
bash: javac: command not found
I attempted to set up the path by following a video on youtube, but it does not seem to have helped.
Any advice would be greatly appreciated.
Thank you in advance.
Upvotes: 0
Views: 914
Reputation: 23
Are you trying to simply install java on your system to run programs or do you want to write and execute code? If you want to just install it for programs, the java website has all the downloads for installing java to run on your system. For writing code, I recommend DrJava, a develpment environment that is both relatively easy to use and has many features that allow for powerful coding abilities, once you learn them and need them. I hope this helps if I understood what you are trying to do.
Upvotes: 0
Reputation: 353
install JDK first in your system.
after do the following
1). My computer -> right click -> Properties
2). Advance System Setting on left side
3). Click on Environment Variable
4). Click new in user Variable For System_name
5). Variable Name:- PATH
Value:- **YOUR JDK PATH UPTO BIN FOLDER** , AT END ";"
Example:- C:\Program Files\Java\jdk1.8.0_45\bin;
Then type JAVA and JAVAC in cmd
Upvotes: 3