LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 11-29-2004, 08:11 PM   #1
mcshen
LQ Newbie
 
Registered: Dec 2003
Distribution: womandrake
Posts: 28

Rep: Reputation: 15
change working directory in java


how can i use java to change the working directory?

here is what i have
-----------------------------
Process child2 = Runtime.getRuntime().exec("cd test");
child2.waitFor();

but the test is not the working directory.

please help
thanks
 
Old 11-30-2004, 02:09 AM   #2
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris 11.4, Oracle Linux, Mint, Debian/WSL
Posts: 9,789

Rep: Reputation: 492Reputation: 492Reputation: 492Reputation: 492Reputation: 492
I don't think there's any portable way to do it, as it would break Java portability but
you can probably do it by using a native method calling chdir.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
what directory is java install? what CMD determined where java is install? Thks. suse2166 Linux - Newbie 2 09-04-2005 08:24 PM
java working, java plugin not provkitir *BSD 3 01-12-2005 05:49 PM
How to change directory windefault Linux - Newbie 5 11-02-2004 04:28 AM
Web start java not working (java works fine) powadha Debian 5 06-05-2004 12:57 PM
mountig - change ro to rw, delete directory, change rw to ro ?? itsjustme Linux - General 6 10-17-2003 11:48 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 02:11 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration