Announcement

Collapse
No announcement yet.

Java things

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Java things

    Does anyone know what I need for Java? I've been wanting to try the language having done C++ and Ruby before.

    I have gcj and gij installed. I use KDevelop for editor.

    Anything else I should have? How do I compile code on Java btw?

    #2
    Re: Java things

    Ive never personally used Kdevelop just because its too complicated, and no one has ever showed me. For small java programs I use kate. But for a large project you micht want to try Eclipse (http://www.eclipse.org/). You should have the j2sdk1.4 package installed so because it comes with the compiler. If you want the newest version, go to java.sun.com.
    Compiling java programs is just like:
    javac *.java

    javac is the compiler ans *.java are your source files.

    Comment


      #3
      Re: Java things

      Yeah I've been using Kate recently,

      Ok compiled the .java file now I've got a .class file....

      Better than what happened with gcj I think, that time I got .o files.

      Comment


        #4
        Re: Java things

        Have you installed kate-plugins too? It has nice features such as symbol list etc. Eclipse is also great, but I find it 'slow-to-respond', such as most of the java programs.

        Comment


          #5
          Re: Java things

          I have Kate's plugins and KWrite's plugins in Kate.

          ~ Patrick

          P.S What do I do with the *.class files?

          Comment


            #6
            Re: Java things

            You run them.

            In order to execute a java class it needs to have the static main method.
            Code:
            java <classname>
            is the simplest way to execute the class. However if you have put your class into a package (which is normally good practice) then you need to specify the full name of the class including the package, like com.foo.bar.Test. The java interpreter uses the classpath to find the class definition. Classes are either the .class files, or zipped up together in a jar file.

            Blog: Tasty Tidbits

            Comment


              #7
              Re: Java things

              Yes!! That did it! Thanks thumper (again ).

              Comment


                #8
                Re: Java things

                I've just done a semester of java at uni.

                I tried out quite a few IDEs and I settled on using NetBeans from http://www.netbeans.org/ . I thought it was an excellent IDE.

                You can also download both NetBeans and the java SDK as one package from http://java.sun.com/j2se/1.5.0/download.jsp

                HTH.

                Comment


                  #9
                  Re: Java things

                  i use eclipse (www.eclipse.org), but you need the jdk (note: jdk = java development kit --> it has also the compiler, while jre = java runtime environment --> is only a runtime environment (that is also included in the jdk)) as described above
                  a good tutorial:
                  http://java.sun.com/docs/books/tutorial/

                  if you use eclipse, you create a new project, then you can code in java. at the end, you can launch directly your files in eclipse, since it compile them without your assistance

                  Comment


                    #10
                    Re: Java things

                    Well, I've been using NetBeans for Java. For bigger programs, you might want to try it out.That or Eclipse, both are good. For smaller projects, Kate is still the best..
                    Dax Solomon Umaming<br />http://blog.knightlust.com/

                    Comment


                      #11
                      Re: Java things

                      For learning the language, stay away from IDE's - you'll end up learning the IDE, not the language. Kate (or any other editor that does semantic coloring) is just fine for learning. I'd also strongly recommend using Sun's Java Tutorial as your starting point. Just whacking away on Java files, without understanding the JVM, ClassPath, and a whole host of other goodies will actually leave you more frustrated than informed.

                      Personally, I steer clear of gcj and friends - the Sun engine is now under the GPL and the JVM runs more than "fast enough" on modern-day equipment that, to me, obliviates the need to directly compile Java to machine code.
                      E. A. (Ed) Graham, Jr.<br />Professional Java Geek<br />Linux User #28251

                      Comment


                        #12
                        Re: Java things

                        I've dabbled in Java before, I found it wayyyyyyyy to complicated. C/C++ was complex enough for me
                        LINUX. IT&#39;S SO EASY, EVEN A PENGUIN CAN DO IT.

                        Comment

                        Working...
                        X