Question:
help needed with java?
Adam
2008-03-17 02:11:43 UTC
could someone please explain me step by step on how to compile and run and then test a java programme i have written into notepad.
I am starting to learn the basics and need to be able to practise thus i am going to be usnig notepad?
Are there any easier and better programmes i can use to practise my java skills?
Thanks for the help
Six answers:
Ashish Shakya
2008-03-17 02:29:46 UTC
to test the java code.. make sure you have java sdk installed properly.



1. To check if it's properly installed go to command prompt, type javac enter. it should give message other than : 'javac' is not recognized as an internal or external command, operable program or batch file.



if you get other than this type javac and the path of your code [full path like: c:\javacode\HelloWorld.java].



This will compile your java code and create a class file at the location of your HelloWorld.java file.



2. Then to run your code, type java c:\javacode\HelloWorld.class.



This should run your code.



If you want easier way, get IDEs such as Eclipse or NetBeans. They'll help you a long way. My choice is Eclipse.



Cheerz. Good luck with your java.
Stupid Cupid
2008-03-17 02:28:06 UTC
As Warren alluded, you should be using an integrated development environment (IDE) to help you be more productive.



Pick a Java IDE that is actively developed and enhanced, and supports the newest Java features. Two very popular IDEs are Eclipse [1] and NetBeans [2]. You will doubtless hear of others.



Visual J++ was nice in its time, but it's a 10-year-old product that Microsoft no longer supports. (Because of the Sun lawsuit, Microsoft now has nothing to do with Java, instead focusing its efforts on the competing .NET platform.) Therefore, you won't be able to access any modern Java features using Visual J++.
bob j
2008-03-17 02:27:21 UTC
Two big programs to write Java in are netbeans and eclipse. I personaly like netbeans but a lot of people also like eclipse. The are both free so I would try both and see what you like. Both will help you write and debug code. See links below for the sites.



Third link is a walk through to compile a java file by hand in windows but it's about the same if you use linux operating system. As you get bigger programs you will find the programs above better but sometimes it is easier to start out by doing it by hand.
?
2016-12-02 04:12:44 UTC
The langage wherein maximum web pages are written (html) is in a position to exhibit text cloth, photographs and links. yet it is approximately all. For a information superhighway website to do something fancy (including play a interest, animation, tutor video clips, and so on) they use small courses written interior the Java programming language. you're able to desire to have Java on your pc to apply those information superhighway pages. devoid of Java, many information superhighway pages won't artwork.
Nestor
2008-03-17 02:22:27 UTC
1st...Don't do it in notepad...download BlueJ (Java editor for learners ) is free..if you just want to do it by hand...make sure that u have the Java SDK...

anyway... save your program... ex...

file.java

after that open the command prompt

and type

C:\SomeFolderWithYourFile> javac file.java

note you have to set the java path before that or u can write :



C:\SomeFolderWithYourFile>C:\JavacIshere\javac file.java

this will create a File.class file in the same folder of File.java

and then you can run it with



C:\java file

hope that helps
Warren O
2008-03-17 02:18:34 UTC
Visual J++


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...