473,406 Members | 2,312 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Mac Java Error

176 100+
Hello. I have been having problems using pico to develop java programs. I used all the commands in a tutorial I read saying open up terminal and type:

cd
mkdir java
cd java
pico

and I type in the code. When I try to save it by pressing Control-O it prompts me for where it to be and it says:

File Name to Write:

I have no idea where to save it so I typed in /Java/. It then says:

File Exists OVERWRITE ?

and when I type in Y it says Error writing /Java/ is a directory. What do I do?
Apr 22 '08 #1
10 2167
Nepomuk
3,112 Expert 2GB
Hello. I have been having problems using pico to develop java programs. I used all the commands in a tutorial I read saying open up terminal and type:

cd
mkdir java
cd java
pico

and I type in the code. When I try to save it by pressing Control-O it prompts me for where it to be and it says:

File Name to Write:

I have no idea where to save it so I typed in /Java/. It then says:

File Exists OVERWRITE ?

and when I type in Y it says Error writing /Java/ is a directory. What do I do?
Type the name of the file. Like
Expand|Select|Wrap|Line Numbers
  1. test.java
You can also give the file a name from the beginning by calling
Expand|Select|Wrap|Line Numbers
  1. pico test.java
Greetings,
Nepomuk
Apr 22 '08 #2
Kid Programmer
176 100+
Type the name of the file. Like
Expand|Select|Wrap|Line Numbers
  1. test.java
You can also give the file a name from the beginning by calling
Expand|Select|Wrap|Line Numbers
  1. pico test.java
Greetings,
Nepomuk
It doesn't me type anything in the prompt to overwrite or not except for Y and N.
Apr 22 '08 #3
Nepomuk
3,112 Expert 2GB
It doesn't me type anything in the prompt to overwrite or not except for Y and N.
OK, do the following:
  1. type cd
  2. type mkdir java
  3. type cd java
  4. type pico
  5. write your code
  6. press Control-O
  7. type test.java
  8. press enter
  9. It won't prompt you to overwrite you the first time, after that it might. If so, type Y
  10. It won't tell you, that it's a directory
The thing is, you were trying to write the file not in the directory but over the directory (replace the directory with the file). That's why it gives you the error.

Greetings,
Nepomuk
Apr 22 '08 #4
Kid Programmer
176 100+
OK, do the following:
  1. type cd
  2. type mkdir java
  3. type cd java
  4. type pico
  5. write your code
  6. press Control-O
  7. type test.java
  8. press enter
  9. It won't prompt you to overwrite you the first time, after that it might. If so, type Y
  10. It won't tell you, that it's a directory
The thing is, you were trying to write the file not in the directory but over the directory (replace the directory with the file). That's why it gives you the error.

Greetings,
Nepomuk
Thank you that worked but now I have another problem. When I try to compile it I get this error after typing in cd /Java/. I type in javac test.java and it says
error: cannot read: test.java
1 error
Apr 22 '08 #5
Laharl
849 Expert 512MB
Is test.java in that folder? If not, you'll need to go to the folder it is in with cd. Capitalization does matter, fyi, so /Java is different from /java.
Apr 22 '08 #6
Nepomuk
3,112 Expert 2GB
Thank you that worked but now I have another problem. When I try to compile it I get this error after typing in cd /Java/. I type in javac test.java and it says
error: cannot read: test.java
1 error
OK, so you did cd java (without slashes I would guess)? Then type ls and press enter. It should look something like this:
Expand|Select|Wrap|Line Numbers
  1. username@computername:~/java$ ls
  2. test.java
  3.  
(It will probably look a little different, but similar.)
If you don't see test.java you're in the wrong place. If so, find that file.
When you've made sure, you're in the right place, type
Expand|Select|Wrap|Line Numbers
  1. javac test.java
again and, if that works, type
Expand|Select|Wrap|Line Numbers
  1. java test
to test your program.

Oh, and as Laharl mentioned, "Java" is not the same as "java". You created a folder called "java" in your home directory. (At least if OS X works like Linux - which it should, as OS X is Unix based.) The full path to your program is probably something like
Expand|Select|Wrap|Line Numbers
  1. /home/username/java/test.java
Greetings,
Nepomuk
Apr 22 '08 #7
Kid Programmer
176 100+
Is test.java in that folder? If not, you'll need to go to the folder it is in with cd. Capitalization does matter, fyi, so /Java is different from /java.
I am positive it is the right folder.
Apr 22 '08 #8
Kid Programmer
176 100+
I am positive it is the right folder.
I finally got it to work!
Apr 22 '08 #9
Nepomuk
3,112 Expert 2GB
I finally got it to work!
Glad, you've got it running. What was the problem?

Greetings,
Nepomuk
Apr 22 '08 #10
Kid Programmer
176 100+
Glad, you've got it running. What was the problem?

Greetings,
Nepomuk
Apparently the files weren't being saved in the folder. I simply dragged the files into the folder and it was able to find them.
Apr 23 '08 #11

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Kent Lewandowski | last post by:
hi all, Recently I wrote some stored procedures using java jdbc code (admittedly my first stab) and then tried to implement the same within java packages (for code reuse). I encountered...
4
by: acemann7 | last post by:
Windows 2000 udb v 7.2 Got the latest fixpak 13 Applied it. Still can't get a single java sp to run. I used to get reason "2"... now reason "0" - reason 0 is not even documented. I point...
9
by: IchBin | last post by:
I am trying to get Java to work from within PHP. I have been looking at: http://us2.php.net/java The error and line of PHP code: $system = new Java('java.lang.System'); Fatal error: Class...
2
by: ramasubramanian.rahul | last post by:
hi i am trying to call some java APIs from c . i use the standatd JNI calls to load the JVM from a c program and call all java functions by using a pointer to the jvm which was returned by the JNI...
11
by: hamiltongreg | last post by:
I am new to Java and am having problems getting my program to compile correctly. My assignment is as follows; Choose a product that lends itself to an inventory (for example, products at your...
1
by: henrymania | last post by:
Am writing a code for database backup....by backupservlet is as given below i get the following exception
5
by: r035198x | last post by:
Setting up. Getting started To get started with java, one must download and install a version of Sun's JDK (Java Development Kit). The newest release at the time of writting this article is...
11
by: BigZero | last post by:
Hello, can i call Java method.That is java code from php,here what i m looking for i have class called DB in this class all the DB related things ,like DB connection DB insert,DB read etc...
2
by: khalidanwar123 | last post by:
i am getting the following error while updating a clob field. ERROR java.sql.SQLException: Data size bigger than max size forthis type: 4003 19:28:27,499 ERROR at...
2
by: yeshello54 | last post by:
so here is my problem...in a contact manager i am trying to complete i have ran into an error..we have lots of code because we have some from class which we can use...anyways i keep getting an error...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.