Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Hi,I have a minecraft server 99.34.224.29:25565. (all you minecraft buddies are welcomed to visit!) but I have this problem. Sometimes I need to edit .class files remotely because I never have time at home to maintain the server.
SO that raises a question.... is there a java compiler/editor out there that will work in a ssh environment? I use ssh to login the ssh server to access my minecraft files. Is there a java compiler/editor that works in text mode? I Only have to make minor changes so it doesn't have to be with all bells and whistles...just save a few chars.
I spent a hour looking but can't find one...maybe it doesn't exist since Java was conceived during gui times.
The java compiler comes with the JDK, it is CLI only anyways, so no need for an extra one.
All you need besides that is a simple text editor (Vi(m), Emacs, nano, joe, literally dozens of others).
screen full of codes and words ..machine language.
Can JDK open a .class file in SSH session? (no gui allowed)
if it can, do you know where I can get just the JDK editor?
what would the command line be? JDK <Filename.class> ?
screen full of codes and words ..machine language.
Can JDK open a .class file in SSH session? (no gui allowed)
if it can, do you know where I can get just the JDK editor?
what would the command line be? JDK <Filename.class> ?
Thanks
I am not a java expert, but I think the .class files are the compiled java bytecode.
What you want to edit is the uncompiled source, usually .java files of the same name I think.
those files are the .YML files in minecraft.
those are txt files so vim works fine. I wanted to look at
the .class files since I am trying to teach my self and kid Java
I no expert either but I know we have to compile the files.
something I want to learn. I might just use eclipse since its
gui only, I will be limited to doing my edits on the server only
and not remotely.
I don't think a .class editor exist for SSH..something we can use
in a putty session.
But my point was that the .class files are going to look like that in any editor (other than a hex editor which may format them better), so you are not going to be able to learn java by looking at the contents of the .class files.
In other words, the .class files are already compiled.
CAUTION: If you save to the same file without reconverting to binary your original file will be overwritten! Also, editing hex code can easily break the original compiled codes in bad ways, so always work from a copy of the original and keep the original safe and unchanged.
I understand now thanks. before files become .class files they have to be created as .java files in txt format than compiled with java compiler.. think it is javac.
Thats a neat trick with Vim.. I have to speak hex if i really got desperate to make changes
I am trying Jedit now.. but It isn't opening the .class files guess because they are compiled.
hey, I m learning now
so what would you recommend to start writing/compiling .java files to .class?
The moderator said JDK comes with it. I think he means openJDK I have 6 and 7 but my
javac file has broken link so I can't run the compiler. I am assuming trying to use Jedit, it claims to be a programmers editor..... It didn't like the class file tho something about utf-8
I am going to enroll in java classes at the local college.
Author: Kevin Burton, Andre Kaplan, Dirk Moebius Released: 9 May 2007 The JavaInsight plugin adds an action to the file system browser that lets you decompile selected Java classes using the Jode decompiler. Furthermore it adds some actions to view selected classes in disassembled form, either BCEL or Jasmin output.
ah 2007!! too old! it has a java plugin but it will not download cuz its ancient!
I understand now thanks. before files become .class files they have to be created as .java files in txt format than compiled with java compiler.. think it is javac.
Great! Yea, I thought you might have been expecting the class files to be text, they are not.
To be honest, the only reason I spotted it is that my son is teaching me how to find my way around one of his java projects this week, so I had .java, .class, .jar on the brain already!
Yes, the java compiler is javac. On my Slackware system with Oracle java it is /usr/lib/java/bin/javac, not sure where it would be on another system or with OpenJDK. Type whereis javac and see what it says. You might also need to check your CLASSPATH environment variable.
Quote:
Originally Posted by escolom
Thats a neat trick with Vim.. I have to speak hex if i really got desperate to make changes
I am trying Jedit now.. but It isn't opening the .class files guess because they are compiled.
hey, I m learning now
I used to do a LOT in machine code and assembler and edited hex files with one hand tied behind my back! But not so much any more. Vim is my editor of choice, but you might also have hex editor called bpe on your system. Try man bpe or bpe --help.
But with jave there is not much to be gained by that unless you already know the source inside and out.
Quote:
Originally Posted by escolom
so what would you recommend to start writing/compiling .java files to .class?
The moderator said JDK comes with it. I think he means openJDK I have 6 and 7 but my
javac file has broken link so I can't run the compiler. I am assuming trying to use Jedit, it claims to be a programmers editor..... It didn't like the class file tho something about utf-8
I am going to enroll in java classes at the local college.
*cheers*
thank you.
We do all our development using vi (vim) as the editor, not much on GUI tools.
I think the only thing that you need is to find how to invoke the javac compiler on your system and take it from there.
As I said, my son is the java expert here, more like magician, but he is all self taught and uses only vi, jdk and the GNU/Linux tools - great stuff!
Author: Kevin Burton, Andre Kaplan, Dirk Moebius Released: 9 May 2007 The JavaInsight plugin adds an action to the file system browser that lets you decompile selected Java classes using the Jode decompiler. Furthermore it adds some actions to view selected classes in disassembled form, either BCEL or Jasmin output.
ah 2007!! too old! it has a java plugin but it will not download cuz its ancient!
I don't have a favorite java book, but I am sure there are many!
But in my opinion you should try to not get hung up on all the GUI tools, plugins, browsers, etc... they are a distraction and keep you from learning the language.
All you need is a plain text editor and the java compiler, and a little time to play with it. Once you see how it goes from text to bytecode by way of the compiler a whole new world will open for you!
You and your kid inspire me man! I should hire him to do my java stuff for minecraft server. Oh, that wasn't a book it was Jedit about page. Jedit apparently comes with Debian 7 distro, i was just pointing out its ancient. all the editing in Vim sounds perfect for ssh access, I just don't have the skill you have..both hands here
Thanks for the advice about staying away from the java plugins and writing code in txt editor...I can't tell you how many times people have given me that advise.
my javac is located in /usr/lib/java/bin/javac but it says it has a 'broken link'. I had some problems installing Java so I had to use openjdk. Java is running because minecraft runs but when I run javac at terminal its as if the file isn't out there
-bash: javac: command not found
I am not sure what compiler openjdk uses, i will try to find out and post it here.
thanks for all your advise. I am trying to get my 15yr old kid interested in programming. (hence the minecraft server) Glad you were successful with yours.
I hope your kid latches onto programming - I can't imagine anyone not doing so, but especially younger people.
When my son was 12 he took an interest in some of my projects, so I took him on a business trip to a customer site with a large computer center, some unique technology and a lot of friendly people.
I started him with php so that he could write code and see the immediate effect, effective both from a shell or with a browser UI. He devoured it so we got him Stroustroup's C++ books, K&R, a shelf full of O'Reilly and others, and his own computer(s)...
Somewhere in there he taught himself java, probably because it was a language I had never learned, and has written a couple of full featured java applications, and is now trying to explain one of them to my tired old brain.
He is now 26 and works as a programmer and system admin in his own right, among other things!
Good luck to you and your kid!
Last edited by astrogeek; 08-21-2013 at 02:45 PM.
Reason: typos
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.