Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Java Compiler

Posted on 2011-02-27
13
Medium Priority
?
350 Views
Last Modified: 2012-05-11
I have installed a Java compiler.

Per installation instructions, it appears that the installation was successful.    The following snapshots/documents are attached:

1. "Instructions.jpg" -- according to the instructions, "long message" means success
2. "InstructionFeedback.jpg" -- I get this long message... I figure it was installed successfully
3. "HelloWord -- Instructions.pdf" -- per some website, it was recommended to test the installation via compiling the "Hello World" program...
4. Per #3, I followed the compiling of the Hello World program (page 5 of the PDF).   However, I don't get the ".class" file after typing "HelloWorld.java' (I renamed it from HelloWorldApp to HelloWorld).

What am I missing?

EEH


Installation.jpg
InstallationFeedback.jpg
HelloWord----Instructions.pdf
Java.jpg
0
Comment
Question by:ExpExchHelp
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 9
  • 4
13 Comments
 
LVL 47

Expert Comment

by:for_yan
ID: 34992811
It looks that you have runtime environment but not jdk. You can run prigrams
with java command but cannot compile them with javac
0
 
LVL 47

Expert Comment

by:for_yan
ID: 34992831
This statement in your window that before you can run java program you need to have java compiler is not correct.
Before you can run you need to install Java Virtual Machine (they can also call it Java Runtime Environmen)
- the  command java corresponds to that.

If you want to write new programs then you need first to compile  - for that you need to have "javac" command which converts
.java file to .class file. if you already have a .claas fie or a .jar file you don't need to compile.

What I see is that after your installation "java" command is wroking, javac is not -  so probabley you installed
Java Runtime Environemnt (JRE) but not Java Development Environment (JDK).

So you fisrt need tio decide what you need - just to run java programs written by others or you also want to write new java programs of your own
and then install what you need accordingly - JRE or JDK
0
 

Author Comment

by:ExpExchHelp
ID: 34992905
for_yan:

I will have to write new programs as well...

What do I need to download/install?  
Do you have a recommendation for a website (for downloading the required software/components?  
If so, do I need to uninstall the current program for proper installation sequence?

EEH
0
The top UI technologies you need to be aware of

An important part of the job as a front-end developer is to stay up to date and in contact with new tools, trends and workflows. That’s why you cannot miss this upcoming webinar to explore the latest trends in UI technologies!

 
LVL 47

Expert Comment

by:for_yan
ID: 34992920
It is all on the same web page, but make sure you install JDK, not JRE:

http://www.oracle.com/technetwork/java/javase/downloads/index.html

0
 
LVL 47

Expert Comment

by:for_yan
ID: 34992928
You can uninstall just for cleanliness.
In general I guess same version of JDK should install over JRE -
itshould complain if it does not
0
 

Author Comment

by:ExpExchHelp
ID: 34992994
Hmh... that's the same site I when to yesterday.

And, yes, I did install the JDK... not the JRE.   See snapshot (from yesterday's installation).

So, something else must be causing the problem.

Any additional recommendations?

EEH


jdk.jpg
0
 
LVL 47

Expert Comment

by:for_yan
ID: 34993043
Go into bin --> you should have javac.exe in there

then go to you command prompt and type PATH and find first place where
you have jdk.../bin  or jre.../bin in there.

It may well be that you have your installation on your computer but don't have right PATH
 it in your environement, but you have some JRE from the old time in your ebviroemnt,
therefore java works but javac does noot

0
 
LVL 47

Expert Comment

by:for_yan
ID: 34993049
Also type java -version
and compare is it the same version which you downloaded and installed today
0
 
LVL 47

Expert Comment

by:for_yan
ID: 34993076
And ultmately go to control panel --> system -> advanced tab -> envirinement varaibales
and make sure that in the PTH varaiable the first java you encounter should point to
bin under your recent installation folder something like ...\jdk1.6.0_24\bin - it should come before any other java
in your path
0
 
LVL 47

Accepted Solution

by:
for_yan earned 2000 total points
ID: 34993093
I meant of course "PATH" variable or it may be "Path" - it is case insensitve on Windows
If it points to installation of JDK and not to installation of JRE (which may have been on your computer before)
then both java and javac should work from the command prompt and should use the same version of java.

After you change Environemnt in cpntol panel - start new CMD window and check that correct PATH is there.
Then it should work
0
 

Author Comment

by:ExpExchHelp
ID: 34993198
for_yan:

The "devil is in the detail"....  thanks, that did it.

Even though I had added the directory to the systems environment variables, I had called it "java' not "PATH".

Once I changed that, it successfully created the class file.

Thanks again!!

EEH
0
 

Author Closing Comment

by:ExpExchHelp
ID: 34993199
Excellent solution
0
 
LVL 47

Expert Comment

by:for_yan
ID: 34993237
You are always welcome
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.
Suggested Courses

722 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question