Need help -how to use a GUI to compile a file
hello peeps,
I have this problem, let's get directly into it, i have a program that has GUI with a Text Area that im going to copy a text file into it (using JFileChooser FileReader and readLine() ...) so i have radio buttons like (view, compile and execute) and an OK button to get the selected option, what i want to know is how to compile the file that is in the text area, like how to get to the MS-dos console and javac to start. i hope this description is clear, and i'll be very appreciative for any help!
thanks for your response, but its not working it keeps on throwing IOException, i tried to put a direct string into it like (Runtime.getRuntime().exec("javac MyClass.java"); and same thing happend. Am i missing something? like is there something to add before calling that line of code? i did import Runtime
ok here is how my code looks like:
if(compile.isSelected())
try
//name of the file im pasting into the text area
String filename = file.getName();
Runtime.getRuntime().exec("javac" + filename);
catch (IOException e)
System.out.println("error compiling program");
}
Similar Messages
-
Need help how to use itunes card to download music
Need help how to use itunes card to download music
If you want to add the iTunes card to your account, then in the iTunes app on the iPad you should be able to scroll to the bottom of the Music tab and there should be a Redeem button - there is more info here : http://support.apple.com/kb/HT1574
-
Need help: how to use "FileLock"
Hi,
I would like to be able to read the file at any time, but when
write is acquired (assuming the lock is released), no read is allowed
until the lock for the write is released.
How to use FileLock to accomplish this scenario?
Any input is appreciated.
Thanks,
PinI would suppose that the first step would be to determine that the OS you are working on actually supports that...from the java docs...
Platform dependencies
Whether or not a lock actually prevents another program from accessing the content of the locked region is system-dependent and therefore unspecified. -
Need help: how to make a package into a jar file?
I tried to make a package into a jar file by using:
jar cf a.jar packagedirectory
But when I import one class of this package in an other application, by using:
javac -cp path\a.jar; app.java
the compliler can not find the calss.
The interesting thing is if I do not put the package into the jar file, it works well.
Here is my sample code under path D:\b\b1
package b1;
public class Son
int x = 10;
public Son(){
public int getX(){
return x;
and the application code under path d:\b
import b1.Son;
public class Father
public Father(){
public static void main(String[] args)
Son son = new Son();
System.out.println("Hello World!"+son.getX());
Thanks for any advise.
Xin ChengYou must make sure that you are in the right directory
when you do your jar command to create the archive.
[home/trejkaz/proj/test/classes]% jar -cf a.jar
path/to/package/*.class
Thank you very much.
Yes, I did as what you said, but it does not work.
Here is what I did:
1. Edit Father.java in D:\b
2. Edit Son.java in D:\b\b1
3. Compile Son.java
4. Complie Father.java
5. Make the a.jar by
command jar cf a.jar D:\b\b1\ (I cheked the content of the a.jar, it seems right.)
a.jar is in directory D:\b
6. Delete Son.class in D:\b\b1
7. Run Father.class by
command: java -classpath D:\b\a.jar; Father
error message is: Exception in thread "main" java.lang.NoClassDefFoundError: b1/Son
at Father.main(Father.java:11)
What is the problem?
Thanks again. -
I have I pad one use iOS 5.1.1 i want update to iOS 8 itry a lot time but no possible i need help how ican doit.
The iPad 1 can not be upgraded beyond 5.1.1.
-
hii i need help i cannot use my apple id for download on app store because they say i need to verify my account but i don't know how so please somebody can help me? i try to resset my password but that don't help
is it asking for ur security questions?
-
Hi I am new on the Mac, I need help, how can I run my apps from my library on my Mac Pro? All my apps I was used in my iPad, thanks guys!!!!
The Mac OS X and iOS versions are separate products
-
Mail server not responding. Need help how to verify my account
Mail server not responding. Need help how to verify my account
There are instructions on this page for how to create a new account without giving credit card details (the instructions won't work with existing accounts) : http://support.apple.com/kb/HT2534
Unless an account is created via those instructions then credit card details will need to be entered on it before the account can be used. -
I need help, How could I add Aliases to Local Administrator account via terminal commands???
I want to use commands to add alias for existing administrator account remotly by using ARD.
Thanks.Hi,
a Windows Domain Controller does not have any local user or groups. So you might add the user to the admin group at Domain level.
B RGDS,
Gregor
Edited by: Gregor Gasper on Jan 9, 2009 1:44 PM -
my Creative Cloud subscription has expired, and I assigned the monthly payment, but I can not open any progam creative cloud, I need help how to solve this problem
Carlos-
Start by signing out and back in to see if it will see the subscription:
How to sign in and sign out of creative cloud (activate/deactivate)
If the apps are installed fine and close after launch see this link:
CC applications close immediately after launch
If the problem is something different, please let us know the error you see or what is happening on the screen so we can advise you on a solution
Pattie -
Hi, I have this green mark (with pointing arrow looks like a link) on some words show on my window screen when I open a web page, I wonder if it is a virus link or such. Need help how to get rid of it. Here's the example:
WING
GAMES
MAJORITY
ThanksIf the third link you posted (the link containing the word "majority") does not look like the following then you inadvertently installed adware.
That particular page should resemble the following:
The word "majority" in the third paragraph should not be a link and should not have the green icon associated with it.
To learn how this may have occurred, and how to prevent it from occurring in the future, read How to install adware
Most so-called "news" websites are nothing more than entertainment outlets that cater to prurient interests, and contain advertisements that leave the user about three clicks away from installing junk. If you decide to frequent those websites, Safari's "Reader" feature helps minimize that exposure.
Try it: -
How can I get a stripped screw out of the bottom of my iPhone?? I need help, How can I get a stripped screw out of the bottom of my iPhone?? I need help
Try asking at ifixit.com. The iPhone is not considered user servicable. You're not going to get much help on an Apple sponsored forum.
-
Hello. I need help. I use Photoshop Elements 10 on my MAC but it no longer reads discs. Can I download it from the internet with my original package serial number? thanks
Yes, from here:
Download Photoshop Elements products | 13, 12, 11, 10 -
I have lost the use of my extension pannels, and need help recovering the use. I get a message that extensions failed to load. Why?
I've had that before when on a really slow Internet connection.
-
Need help trying to use close button and i really like to know why it off
need help trying to use close button and i really like to know why it off
And in English? You need to explain better.
Mylenium
Maybe you are looking for
-
T5120 cable management arm and exhaust air flow obstruction
Hello Folks Concerning Sun servers of 1-U in height... There is debate as to whether the effectiveness of heat transfer out of the chassis is actually impaired by the use of a cable management arm at the rear of a rack mounted server. From my experie
-
Just purchased Xcelsius Server 2008 and it will not open
I have been using the xcelsius 2008 server trial edition and decided to purchase the full product. After I paid, I received a product key and a link to download. When I open the trial version, it has a link to enter a product key, so I entered the
-
Hierarchy upload-InfoPackage-Hierarchy Selection tab
I have to upload hierarchy for Internal Order. I have InforPackage but on the Hierarchy Selection tab there is no hierarchy that I am supposed to upload (it's called A1). Do I have to extract the missing hierarchy from R/3? Can someone please provide
-
I posted this question over at actionscript.org but It might suit this forum more: I'm trying to create an application with AIR but there is one thing that keeps bugging me and its the vector based fonts, even though I select arial 12px font-weight n
-
Multi Currency in Sales Opportunities
Hi Experts..... If local currency is INR and system currency in EURO then in sales opportunity I want to create new transaction with USD currency. But the potential amount of sales opportunity displays in either local or system currency only. Then ho