Terminal broken?

Joined
Feb 2, 2008
Messages
22
Reaction score
0
Points
1
Your Mac's Specs
Powermac G4, 1GHZ, 1.5GB Ram, 320GB, 320GB, 250GB HDs, Mac OS 10.4.11
Hello.

I am currently reading sams teach yourself java 2 in 24 hours and I got an error when trying to run a compiled script using the terminal.

Emac:~ admin$ javac /J24Work/BigDept.java
Emac:~ admin$ java /J24Work/BigDept
Exception in thread "main" java.lang.NoClassDefFoundError: /J24Work/BigDept
Emac:~ admin$

Anyway. I tried what it said to do on this page:
http://www.ics.uci.edu/~thornton/ics22/LabManual/SettingUpJava.html

Which didnt seem to work, and now, every time i open a new terminal window, I get

Last login: Sun Feb 3 13:38:38 on ttyp1
Welcome to Darwin!

Without the prompt, and none of the commands work.

If I close the window, i get a message saying:

Closing this window will terminate the following processes inside it: login, bash, cat

So I hit terminate.

Terminate doesnt seem to work however, as it still does the same thing whenever I open a new terminal window.

Any ideas why, and how to fix it?
Also if you could tell me why I got that error when interpreting the compiled script then that would be great aswell.

Thanks.
 

rman


Retired Staff
Joined
Dec 24, 2002
Messages
12,637
Reaction score
168
Points
63
Location
Los Angeles, California
Your Mac's Specs
14in MacBook Pro M1 Max 32GB 2TB
If you are comfortable working in the shell environment. Then try booting into single user mode. Once in single user mode, move to you user accounts home folder/directory. Take a look at your dot files (.profile, .cshrc, .login, etc) to be sure they are not corrupted.
 

rman


Retired Staff
Joined
Dec 24, 2002
Messages
12,637
Reaction score
168
Points
63
Location
Los Angeles, California
Your Mac's Specs
14in MacBook Pro M1 Max 32GB 2TB
You may want also look at system preferences -> accounts ->login items tab. For your account and more sure there is nothing that has been added.
 
Joined
Mar 9, 2004
Messages
9,065
Reaction score
331
Points
83
Location
Munich
Your Mac's Specs
Aluminium Macbook 2.4 Ghz 4GB RAM, SSD 24" Samsung Display, iPhone 4, iPad 2
Does "Emac:~ admin$ javac /J24Work/BigDept.java" complete correctly?

Meaning, do you see a "BigDept.class" file in that directory?

Is the .java file really located at the top of your harddrive in the "J24Work" directory? Or is in in your user's folder?

The error basically means java can't find something that it needs to run the app.

Which version of OS X are you running?
Normally OS X comes with everything you need to run apps the way you did from the command line...
 
OP
E
Joined
Feb 2, 2008
Messages
22
Reaction score
0
Points
1
Your Mac's Specs
Powermac G4, 1GHZ, 1.5GB Ram, 320GB, 320GB, 250GB HDs, Mac OS 10.4.11
Does "Emac:~ admin$ javac /J24Work/BigDept.java" complete correctly?

Meaning, do you see a "BigDept.class" file in that directory?

Is the .java file really located at the top of your harddrive in the "J24Work" directory? Or is in in your user's folder?

The error basically means java can't find something that it needs to run the app.

Which version of OS X are you running?
Normally OS X comes with everything you need to run apps the way you did from the command line...

Yes the BigDept.class file is been created in that directory.

I am currently running os x 10.3.9.

Upgrading to tiger soon.

Thanks
 
OP
E
Joined
Feb 2, 2008
Messages
22
Reaction score
0
Points
1
Your Mac's Specs
Powermac G4, 1GHZ, 1.5GB Ram, 320GB, 320GB, 250GB HDs, Mac OS 10.4.11
Thanks but im not that fussed about it anymore since i found the SDK Eclipse which seems to be pretty good for developing java applications/applets.

I figure that once I get tiger this problem with the terminal will fix itself. But ill keep your link bookmarked.

Cheers.
 
Joined
Mar 9, 2004
Messages
9,065
Reaction score
331
Points
83
Location
Munich
Your Mac's Specs
Aluminium Macbook 2.4 Ghz 4GB RAM, SSD 24" Samsung Display, iPhone 4, iPad 2
Yeah, I use eclipse almost exclusively now as well...
It's a bit much for starting out, but if you're serious about getting into Java that's what the pros use :)
 
Joined
Feb 10, 2008
Messages
3
Reaction score
0
Points
1
Im having trouble with terminal

I am also having trouble with terminal. The problems aren't the same but they are confusing. I type this in terminal : bzfs.txt I have this file on my mac but after it says :-bash: bzfs.txt: command not found What does "command not found" mean? Please help
 

rman


Retired Staff
Joined
Dec 24, 2002
Messages
12,637
Reaction score
168
Points
63
Location
Los Angeles, California
Your Mac's Specs
14in MacBook Pro M1 Max 32GB 2TB
higher43 it appears that your issue is different than Elan's . It appears that you are trying to execute (run) a text file (bzfs.txt). That is why you received a command not found. bzfs.txt is not a command or it does not have excute permissions.

Also higher43 it would be better to start your on thread, than to hijack someone else, when your problem is not the same.
 
Joined
Mar 14, 2005
Messages
443
Reaction score
3
Points
18
Location
Atlanta, GA
Your Mac's Specs
17" Macbook Pro Unibody 2.66 Ghz and Powerbook G4 1.67 GHz 2.0GB RAM
Higher43:

I believe you need to use an editing program to open the file. Some examples are emacs, which the OP is using. I personally use VI though the learning curve on it is much steeper. Emacs is pretty much like most text editors, you just open type and that's what you get. Others use "pico" which is pretty easy too. However, as with most programs with steep learning curves, once you fight through it you feel very comfortable and feel unproductive using anything else. So choose wisely.

Google

Emacs
VIM
Pico

See which one you like best. Hope that helps.
 
OP
E
Joined
Feb 2, 2008
Messages
22
Reaction score
0
Points
1
Your Mac's Specs
Powermac G4, 1GHZ, 1.5GB Ram, 320GB, 320GB, 250GB HDs, Mac OS 10.4.11
If you are comfortable working in the shell environment. Then try booting into single user mode. Once in single user mode, move to you user accounts home folder/directory. Take a look at your dot files (.profile, .cshrc, .login, etc) to be sure they are not corrupted.

Hmm I tried reinstalling my software and it didnt seem to fix the problem.

Actually I do not know that much about the shell enviroment.

After booting into single user mode, what commands should I do to check if thoughs files are not courrupt?

Thanks.
 
OP
E
Joined
Feb 2, 2008
Messages
22
Reaction score
0
Points
1
Your Mac's Specs
Powermac G4, 1GHZ, 1.5GB Ram, 320GB, 320GB, 250GB HDs, Mac OS 10.4.11
The terminal seems to be working fine when i use it from another account, does that help?

Also if I hit control D multiple times, I seem to be getting results from commands I have executed in the past.

Last login: Thu Mar 13 13:35:17 on ttyp1
Welcome to Darwin!
Exception in thread "main" java.lang.NoClassDefFoundError: /J24Work/BigDept
java version "1.4.2_16"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_16-b05-303)
Java HotSpot(TM) Client VM (build 1.4.2-86, mixed mode)
-bash: emac:: command not found
-bash: djava: command not found
java version "1.4.2_16"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_16-b05-303)
Java HotSpot(TM) Client VM (build 1.4.2-86, mixed mode)
[Process completed]

Yeah I need to fix this problem since installing tiger didnt do it.

Any help appreciated.

Thanks.
 
OP
E
Joined
Feb 2, 2008
Messages
22
Reaction score
0
Points
1
Your Mac's Specs
Powermac G4, 1GHZ, 1.5GB Ram, 320GB, 320GB, 250GB HDs, Mac OS 10.4.11
The terminal functions fine if I hit control C when I open it, but it would be nice to not have to hit control C every time I want to use it.
 

rman


Retired Staff
Joined
Dec 24, 2002
Messages
12,637
Reaction score
168
Points
63
Location
Los Angeles, California
Your Mac's Specs
14in MacBook Pro M1 Max 32GB 2TB
The terminal seems to be working fine when i use it from another account, does that help?

Also if I hit control D multiple times, I seem to be getting results from commands I have executed in the past.

Last login: Thu Mar 13 13:35:17 on ttyp1
Welcome to Darwin!
Exception in thread "main" java.lang.NoClassDefFoundError: /J24Work/BigDept
java version "1.4.2_16"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_16-b05-303)
Java HotSpot(TM) Client VM (build 1.4.2-86, mixed mode)
-bash: emac:: command not found
-bash: djava: command not found
java version "1.4.2_16"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_16-b05-303)
Java HotSpot(TM) Client VM (build 1.4.2-86, mixed mode)
[Process completed]

Yeah I need to fix this problem since installing tiger didnt do it.

Any help appreciated.

Thanks.
Am I understanding you correctly. If you use another account you don't have a problem with the terminal application?

looking at the above. It appears that on start of the terminal application you are trying to execute emacs and djava.

Check and see if you have one of the following:

.profile
.bash_profile
.bash_login

In one of these files you may have something that maybe causing your problem.
 
Joined
Feb 14, 2004
Messages
4,781
Reaction score
166
Points
63
Location
Groves, Texas
I am also having trouble with terminal. The problems aren't the same but they are confusing. I type this in terminal : bzfs.txt I have this file on my mac but after it says :-bash: bzfs.txt: command not found What does "command not found" mean? Please help

You are trying to run a file in your home dir and it's not in your path.
You need to type: ./bzfs.txt
note the period-slash
Also this need to be an executable file (it probably is if you got it from the same source as I did - BZFlag rocks).
 
OP
E
Joined
Feb 2, 2008
Messages
22
Reaction score
0
Points
1
Your Mac's Specs
Powermac G4, 1GHZ, 1.5GB Ram, 320GB, 320GB, 250GB HDs, Mac OS 10.4.11
Check and see if you have one of the following:

.profile
.bash_profile
.bash_login

Sorry I am rather new to the terminal.

How do I do this?
 

rman


Retired Staff
Joined
Dec 24, 2002
Messages
12,637
Reaction score
168
Points
63
Location
Los Angeles, California
Your Mac's Specs
14in MacBook Pro M1 Max 32GB 2TB
Once you have done the control c to get the prompt. Enter ls -al to get a directory listing. You should see the files if they exist.
 
OP
E
Joined
Feb 2, 2008
Messages
22
Reaction score
0
Points
1
Your Mac's Specs
Powermac G4, 1GHZ, 1.5GB Ram, 320GB, 320GB, 250GB HDs, Mac OS 10.4.11
Thanks.

That displayed quite a big list.

I found:
-rw-r--r-- 1 admin staff 1799 Mar 13 21:03 .profile

in it.

Didnt see any .bash_profile or .bash_login though.
 
OP
E
Joined
Feb 2, 2008
Messages
22
Reaction score
0
Points
1
Your Mac's Specs
Powermac G4, 1GHZ, 1.5GB Ram, 320GB, 320GB, 250GB HDs, Mac OS 10.4.11
Yes umm.. What does that mean?
 

Shop Amazon


Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.
Top