Can I create Java programs with this?

357mag

Newcomer
Joined
Mar 25, 2005
Messages
4
I'm having a very hard time getting j2sdk1.4.2 to work. I can write the code for a simple program in Notepad okay and save the file to my folder okay, but when I open up a command window and type the command to invoke the compiler, nope. No way. Does not work. And I've tried typing many different things and changing the path variable but all fails.

Actually even though I pretty much a beginner to Java(I have done some console programming with C++) I would prefer to use a tool that will allow me to write my code in the code window, and secondly allow me to compile and run the program from within the IDE. Now my question is will J# allow me to do those two things? And can I write simple console programs with J#? And why does Microsoft call it J#? Is it similar to C#?
 
357mag said:
I'm having a very hard time getting j2sdk1.4.2 to work. I can write the code for a simple program in Notepad okay and save the file to my folder okay, but when I open up a command window and type the command to invoke the compiler, nope. No way. Does not work. And I've tried typing many different things and changing the path variable but all fails.

Actually even though I pretty much a beginner to Java(I have done some console programming with C++) I would prefer to use a tool that will allow me to write my code in the code window, and secondly allow me to compile and run the program from within the IDE. Now my question is will J# allow me to do those two things? And can I write simple console programs with J#? And why does Microsoft call it J#? Is it similar to C#?
J# is just an attempt by Microsoft to lure Java developers to .NET. It's Java syntax that allows access to .NET libraries. I have no idea on how good it does everything... I have never really used it.
 
357mag said:
I'm having a very hard time getting j2sdk1.4.2 to work. I can write the code for a simple program in Notepad okay and save the file to my folder okay, but when I open up a command window and type the command to invoke the compiler, nope. No way. Does not work. And I've tried typing many different things and changing the path variable but all fails.

Actually even though I pretty much a beginner to Java(I have done some console programming with C++) I would prefer to use a tool that will allow me to write my code in the code window, and secondly allow me to compile and run the program from within the IDE. Now my question is will J# allow me to do those two things? And can I write simple console programs with J#? And why does Microsoft call it J#? Is it similar to C#?

J#, C#, VB.Net - all about 99% the same. I'd say VB.net is further different from J# and C#. J# is called J# because it's not Java. it's their port of its syntax for .Net.

If you're not INTO Java I'd suggest going with C#. very similar and you'll find a ton more documentation help on it.

The only great benefits I've found from J# that the other .Net languages cannot do (I have no evidance that C# or VB.Net can do this) is to create a webcontrol that acts as a web applet. It's apparently a fairly straightforward conversion from a normal Java Applet.

If you want to do Java, I suggest downloading Borlands JBuilder 2005 Foundation. It's free - even for commercial use - is a fully featured IDE with code completion and compiling within the IDE. I don't like it as much as Visual Studio - but it works well when I need to get some Java done (not very often)
 
If you want to do Java, I suggest downloading Borlands JBuilder 2005 Foundation. It's free - even for commercial use - is a fully featured IDE with code completion and compiling within the IDE. I don't like it as much as Visual Studio - but it works well when I need to get some Java done (not very often)[/QUOTE]

Well actually I did download Borland's Foundation and I found it very complicated to use. When you start a new project the code window already has a bunch of complicated code in it's window. That I don't want or need at this point. I want to use an IDE that will allow me to start a new project with an absolutely empty code window, in which I can type my code from my book, hit the compile and run button, and my program runs. I have not found a way to do that in JBuilder yet. If you know how, by all means please post some step by step instructions for me to follow and I'll try them.
 
357mag said:
Well actually I did download Borland's Foundation and I found it very complicated to use. When you start a new project the code window already has a bunch of complicated code in it's window. That I don't want or need at this point.

What you need at this point is to understand how to get around in the basic syntax of Java before trying to get ahead.

In Jbuilder you start a new project with nothing and have to add a class to do anything. This is what you get when you add a class:

Code:
/**
 * <p>Title: </p>
 *
 * <p>Description: </p>
 *
 * <p>Copyright: Copyright (c) 2005</p>
 *
 * <p>Company: </p>
 *
 * @author not attributable
 * @version 1.0
 */

public class Test {
    public Test() {
    }

    public static void main(String[] args) {
        Test test = new Test();
    }
}

The top portion with the astericks are just comments. You can delete them.

After that is the class test. This is the clase you want to type your code into.

After that is a public procedure Test and main, I'm a bit fuzzy (it's been a year since I've REALLY used Java) , but I believe main runs when your application starts and initializes your class - the Test procedure is run when the class is initialized.

You need to create procedures to place your code or place your code within these lines of code you say you do not need.

I want to use an IDE that will allow me to start a new project with an absolutely empty code window, in which I can type my code from my book, hit the compile and run button, and my program runs. I have not found a way to do that in JBuilder yet.

You won't find a way to do that in any language that I know of short of BASIC maybe... VB6 has very little code in the window because it's all hidden from you.

The code generated above is pretty much standard requirements to run for Java, C#, J# and VB.net.

If you're learning Java, you shouldn't be touching the keyboard until you know what these things are:

Class
Constructor
Method
Comments
Basic variable types (String, char, int, double, etc)
Basic Java I/O methods.

If you don't understand what these things mean and how they appear in code, you won't understand what is happening and like now you'll get confused and angry when something doesn't work 100% and you get lost.

Java isn't an "empty code box" language and if someone did create an IDE with an option like that, they would be doing you (and their customers) a disscervice and it would hinder you much more than it would help in the long run.

Oh, PS, this is a .Net forum, not a Java forum. A Java forum will be best equipped to help you learn Java. You want to learn .Net (C#, J# or VB.Net) stick around here :D
 
Thing is I have a Deitel book laying around and the very first example says to just type this:

public class Welcome{
public static void main(String args[])
{
System.out.println("Welcome to Java!");
}
}

And when you run the program it's supposed to output this:

Welcome to Java!

That's why I'm
'so confused about like what you typed. My book does not say to type that extra stuff. Of course my book is 5 years old so maybe things have changed since then I don't know. I did pick up a more recent book which I have not looked at yet.
 
357mag said:
Thing is I have a Deitel book laying around and the very first example says to just type this:

public class Welcome{
public static void main(String args[])
{
System.out.println("Welcome to Java!");
}
}

Thats what it will look like if you do it in notepad or some other text editor. Applications like Borland and Visual Studio fill in the crap for you. You can always delete that and start over, but that information is still required.

In borland JBuilder you start a new project, add a new class called Welcome and delete all of the text. Then type what you have in the book.

The most important part to understand is that "Public Class Welcome" is your class and will become an object at runtime (similar as how a blueprint for a house becomes a house when built).

You need to be able to identify all the parts you're typing or you're not learning anything.

"Public Static Void Main" is the constructor. Public means its accessable to anything, I believe Static means it doesn't have to be instantiated (using the new keyword) and void is the return type of data. Void is nothing.

So when you look at it, you know that this is a procedure that will run when the class is built and will return nothing.

If you don't know basic things like this and what I typed above, you're stuck where you were - which was being confused because you didn't understand what the skeleton code was there for, how to modify it and how you can use it.

I'd say that any IDE worth it's salt will give you that information when you create a new class. It's just useless typing otherwise.

Nomatter what, if you want to create a class called Welcome, it will have this code:

Code:
Public Class Welcome
{
public static void main(String args[])
   {
      
   }
}

so there isn't any reason for a developer to have to type it. Sure you might change Public to Private or something... but this is all standard code for a class.

I think thats a poor book you're learning from (for a newbie to programming) or you're not using it properly by skipping the required reading and just typing code in or they assume you already know more about programming.
 
That is the very first example in the book. And I've seen that example or those very similar in lots of different sources. Even though the book is actually 5 years old I would imagine it still holds true.

I did follow your suggestions concerning JBuilder and when I clicked the Run button I was presented with a Run Configuration Box. I didn't know how to answer so I just hit OK. Then I got "Unable to start runtime due to incomplete configuration."
 
Last edited:
Back
Top