Skip to main content
GameDev.net gamedev.net
🔒 Locked

[java] little Java help?

Started by OrbotDotH Jun 5, 2002 at 4:30 PM 5 replies 550+ views
Original Post
OrbotDotH
OrbotDotH
I am new to Java and have a few basic questions. I just downloaded the Java 2 1.4 JRE & SDK. I''m using an IDE called JCreator and have it set up fine, but shouldn''t I be able to type "javac whatever.java" and then "java whatever.class" at the DOS prompt to compile and run too? This doesn''t work. How do I set this up? (I''m using Win98) Also, is it possible to use OpenGL with Java? And finally, are making singleton classes preferred in Java? (I have a C++ background.) Is this commonly done or is there some other Java-ish method to accomplish the same thing? Thanks!!!!
m_wherrett
m_wherrett
Whenever you type "javac whatever.java" windows has no idea where to find javac or any of the other JDK tools. Whilst in your dos prompt I believe you can set the necessary path to the JDK tools using the following command... (I think its right)

SET PATH=C:\Java\JDK1.4\bin (or wherever your JDK bin is)

The command simply informs windows that there are useful tools in there that you will want to use every so often.

If that works then you can add it to your autoexec and you wont have to do it every time you open a dos prompt.

As for GL in Java. I believe there is a GL4Java kit out there. I have no idea how to use it or how good it is but a quick search on this very forum should reap rewards.

Anyway, hope that helped and didn''t sound to condescending.

P.S. I aint got a clue about singletons so someone else will have to tell you about them.
m_wherrett
m_wherrett
Seconds later and I''ve found that GL 4 Java stuff...

http://jausoft.com/gl4java/

hope that helps.
OrbotDotH
OrbotDotH
Thanks for the quick answers! Everything is working perfectly now!
mjacobsca
mjacobsca
I use singletons all the time in Java. I typically design with Manager type design patterns, and usually I want one manager to exist for the application, especially in a multithreaded situation where two different threads may need to access the "FileManager", or the "SoundManager", or the "InputManager", for instance. Singletons really help there. They are very easy to create in Java. Just have a private static member variable to store your class instance, a private constructor, and then a getManager() method that creates and returns the static.
jwalker
jwalker
instead of openGL for java, try using java3d.
java3d uses opengl for rendering, but provides a scene graph API.
its much simpler to use for begineers, but lacking in functionality...

java3d supposedly can use direct3d also, but much worse support and performance...



Its my duty, to please that booty ! - John Shaft

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.