English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories
0

I bought a JAVA book and just began reading it. The book told me to download JDK, But i intalled both JDK and SDK.
I have no idea what they are, and the question is i dont know know to open JDK. Please tell me how to do it. I am new to programming. Please help me.

2007-09-22 20:16:05 · 3 answers · asked by volvo942 1 in Computers & Internet Programming & Design

3 answers

Go to the following URL.
http://java.sun.com/javase/downloads/index.jsp

Choose the following Download.
"JDK 6 Update 2 with NetBeans 5.5.1"

On the first download page choose
"Java SE Development Kit 6u2 and NetBeans IDE 5.5.1 Bundle Downloads " ------->"JDK 6u2 with NetBeans IDE 5.5.1 Bundle"

HERE U SHALL ALSO GET INSTALLATION INSTRUCTIONS.

From the next download page Download J2SE6 appropriate for your Operating system.

INSTALL J2SE6

Set JAVA_HOME, PATH, CLASSPATH.
To compile use from command line
javac MyProg.java

To run use from command line
java MyProg

Hope that will serve your purpose.

AFTER UR MESSAGE WHICH IS AS FOLLOWS:

Message: I have intalled JDK 6 Update 2 with NetBeans 5.5.1 as you told me. netbean is shown on the screen and can be open. I dont know how to open JDK6. I know it exists in the program files as the "Java" file. I got into "jdk1.6.0_02" in the "Java" file and I saw
alot of files and documents. Please tell me how to just open JDK and use it. Sincerely Daniel.

MY REPLY:


1> What's ur OS? Always mention it while asking system related questions .

2>
A>
If ur OS is one of Windows family then usually the installer sets JAVA_HOME, PATH, CLASSPATH. As u mentioned that NetBeans can be opened, most probably the environment variables has been set by the installer.
In that case JDK can be used.
Just go to command prompt (c:> ) and give command

javac

If u get output as follows then the java compiler is working fine.

C:\Documents and Settings\Administrator>javac
Usage: javac
where possible options include:
-g Generate all debugging info
-g:none Generate no debugging info
-g:{lines,vars,source} Generate only some debugging info
-nowarn Generate no warnings
-verbose Output messages about what the compiler is doing
-deprecation Output source locations where deprecated APIs are used
-classpath Specify where to find user class files and annotation processors
-cp Specify where to find user class files and annotation processors
-sourcepath Specify where to find input source files
-bootclasspath Override location of bootstrap class files
-extdirs Override location of installed extensions
-endorseddirs Override location of endorsed standards path
-proc:{none,only} Control whether annotation processing and/or compilation is done.
-processor [,,...]Names of the annotation processors to run; bypasses default discovery proces
s
-processorpath Specify where to find annotation processors
-d Specify where to place generated class files
-s Specify where to place generated source files
-implicit:{none,class} Specify whether or not to generate class files for implicitly referenced files
-encoding Specify character encoding used by source files
-source Provide source compatibility with specified release
-target Generate class files for specific VM version
-version Version information
-help Print a synopsis of standard options
-Akey[=value] Options to pass to annotation processors
-X Print a synopsis of nonstandard options
-J Pass directly to the runtime system

Now give command java. If u get output as follows then the JRE is also working fine.

C:\Documents and Settings\Administrator>java
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
-classpath
A ; separated list of directories, JAR archives,
and ZIP archives to search for class files.
-D=
set a system property
-verbose[:class|gc|jni]
enable verbose output
-version print product version and exit
-version:
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[:...|:]
-enableassertions[:...|:]
enable assertions
-da[:...|:]
-disableassertions[:...|:]
disable assertions
-esa | -enablesystemassertions
enable system assertions
-dsa | -disablesystemassertions
disable system assertions
-agentlib:[=]
load native agent library , e.g. -agentlib:hprof
see also, -agentlib:jdwp=help and -agentlib:hprof=help
-agentpath:[=]
load native agent library by full pathname
-javaagent:[=]
load Java programming language agent, see java.lang.instrument
-splash:
show splash screen with specified image



So write ur first program and compile with

javac MyFirstProg.java

Then run it with

java MyFirstProg

If u r expecting some GUI for JAVA compiler or JRE then there's none.
These tools are command line tools.

B>
If the instructions in A> fails then u r to set the environment variables manually in the config file of ur OS. For Win family OS u can do that from Control Panel--> System---> Advanced ---> Environment Variables.

Assuming ur java installation directory is
c:\Program Files\java\jdk1.6.0_02

i> Set JAVA_HOME to

c:\PROGRA~1\java\jdk1.6.0_02

ii>Ur existing path will probably look like something below
%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;

Append to it the following
.;c:\program files\java\jdk1.6.0_02\bin;c:\program files\java\jdk1.6.0_02\lib;c:\program files\java\jdk1.6.0_02\jre\bin;c:\program files\java\jdk1.6.0_02\jre\lib;

iii> Set ur classpath to
.;c:\program files\java\jdk1.6.0_02\jre\lib;c:\program files\java\jdk1.6.0_02\lib;

iv> Reboot
v> Apply the tests mentioned in 2>A> to check ur installation.

C> If ur OS is from UNIX family then u need to set the environment variables in /etc/profile in a similar way. Use any editor vi, joe, pico....
to do that.

2007-09-22 23:20:31 · answer #1 · answered by binaryFusion 5 · 0 0

You only need to worry about the SDK and the JRE (java runtime environment ie. the client piece). The SDKs contain the Sun Java System Application Server (Sun's supported distribution of GlassFish) and provide support for Java EE 5 specifications. The new Java Application Platform SDK features additional runtimes such as Open ESB with JBI and BPEL, Portlet Container, Dynamic Faces, jMaki (Ajax), Phobos, jRuby, Rome, Atom, REST, WADL, Blogapps, and Sun Java System Access Manager

2016-05-21 05:14:10 · answer #2 · answered by Anonymous · 0 0

Start here

2007-09-22 21:00:40 · answer #3 · answered by AnalProgrammer 7 · 0 1

fedest.com, questions and answers