1

I have ubuntu 13.10 and I am trying to use a disk that contains a book, How to program Java, 7th edition. It is the Linux version CD and I can't figure out what program to use so I can look at the files on it.

All of the files are in .class format. I have used the windows version on another pc and it seems to work fine with jgrasp, is there something else I should be using to edit and create java programs with the .class extension?

terdon
  • 100,812
user252400
  • 11
  • 1
  • What exactly are you looking for? An IDE? Any old text editor can open .class files iirc. – Seth Feb 26 '14 at 21:30
  • any editor that would open .class files. I can't seem to open any of the .class files. I am about ready to just give up. – user252400 Feb 27 '14 at 03:16

1 Answers1

0

Let me suggest you have HelloWorld.class file inside some directory. To run it, you simply should type in this directory:

java HelloWorld

To run jar archive, use -jar key:

java -jar MyProgram.jar

To select java machine, type:

sudo update-alternatives --config java

To install Oracle JDK:

sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-jdk7-installer

After installation, you can select it as default java.

Danatela
  • 13,243
  • 11
  • 45
  • 72