Results 1 to 11 of 11
- 01-12-2011, 07:14 PM #1
Member
- Join Date
- Jan 2011
- Posts
- 4
- Rep Power
- 0
Help please with a simple code change?!
Hello all,
Please can I precede my comments by stating that I have no programming experience but I am a graduate Psychologist in need of some programming advice with a project that I need to work on urgently. I am willing to offer a thank you payment to anyone who can help or a donation to your charity of choice.
I am looking to change just one number within an existing and working java code (several times over), and am aware of some basic things I need to do to achieve this, but no idea how to do them, I have tried to use some online guides but it's well above my comprehension...
I use a PC, with Vista operating system and Google Chrome, and the code is written on a notepad file. The code (named "control") is stored within a folder on my desktop along with a corresponding CLASS file of the same name; a further code file name "more applet" and corresponding CLASS file of the same name; and chrome HTML document.
1) I am aware that I need to set my system's search path to the java directory, however unsure of how to do this?
2) I can call the "call javac.exe" to compile the revised code. I really dont know how to do this?
So far I have been able to download the Java Developers Kit, and have been able to find the java directory (I think) using DOS. However where I go from here in terms of matching up DOS, Java and my code files, I really am stuck.
Thank you in advance and sorry if this is a really cheeky request, I hope you can help.Last edited by kieran; 01-12-2011 at 07:16 PM.
- 01-12-2011, 08:16 PM #2
- Join Date
- Jan 2011
- Location
- Richmond, Virginia
- Posts
- 3,068
- Blog Entries
- 3
- Rep Power
- 15
you need to navigate to the file location using cd first, then when in the directory where the file you want to compile is, type:
Java Code:javac filename.java.
Java Code:java filename
The New Boston » Java Programming Tutorial – 1 – Installing the JDKLast edited by sunde887; 01-12-2011 at 08:28 PM.
- 01-12-2011, 09:18 PM #3
Member
- Join Date
- Jan 2011
- Posts
- 4
- Rep Power
- 0
Thanks for your reply, I am able to navigate to the file, but setting the javac path seems to be beyond me. A friend with some computer skills has told me now even how to use the full path to javac, however now I have a different problem, when I try to call the .java file to make changes to the class file, it now says that there are 3 warning about deprecations, this I have no clue how to rectify...
..I felt like I was really getting somewhere till then!:D
- 01-12-2011, 09:30 PM #4
- Join Date
- Jan 2011
- Location
- Richmond, Virginia
- Posts
- 3,068
- Blog Entries
- 3
- Rep Power
- 15
The deprecation is unfortunately a bit beyond what I know currently, you were able to get the path set to allow you to javac though?
- 01-12-2011, 09:31 PM #5
Member
- Join Date
- Jan 2011
- Posts
- 4
- Rep Power
- 0
Thanks sunde, yeah as far as I am aware apart from these deprecations, I would be able to run the modified code
- 01-12-2011, 09:39 PM #6
Warnings can be ignored - they are just warnings. Errors on the other hand cannot.
So, don't worry about that. For javac to work properly, you need to set the CLASSPATH environment variable in windows to match the location of your java install. The variable is usually under 'My Computer/Properties/Advanced/Environment Variables' in windows XP - might be slightly different in vista.
If the path is set, then going to your project folder via command line and running 'javac MyFile.java' where MyFile.java is whatever your file is called, should work. See the oracle website for help with setting the path.
If all that works for you, then you can compile and safely ignore deprecation warnings. To run the resulting program, you can type:
java MyFile
where MyFile is the same name as the MyFile.java. After compilation, several .class files will appear, when you run java MyFile, it is these class files you are executing. Does that help at all?
- 01-12-2011, 10:14 PM #7
Member
- Join Date
- Jan 2011
- Posts
- 4
- Rep Power
- 0
Thank you so much for the advice, im going to have a bit more of a play around and see how I get on
- 01-13-2011, 02:58 PM #8
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 14,422
- Blog Entries
- 7
- Rep Power
- 29
- 01-13-2011, 03:08 PM #9
haha, Specifically deprecation warnings in someone else's code :D
- 01-13-2011, 03:28 PM #10
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 14,422
- Blog Entries
- 7
- Rep Power
- 29
- 01-13-2011, 04:32 PM #11
Similar Threads
-
I have c++ code for LUDO Game, Can anyone change it to Java file - Please help me
By Bhanu Sagar in forum AWT / SwingReplies: 2Last Post: 02-19-2014, 05:36 PM -
Unable to change the system time in Ubuntu using the given code
By manojpant2002 in forum New To JavaReplies: 2Last Post: 01-09-2010, 06:05 AM -
Debug gives same result when I change the code!
By RedSix in forum NetBeansReplies: 3Last Post: 04-14-2009, 04:44 PM -
my code doesn't change background color
By javanoobita in forum New To JavaReplies: 5Last Post: 02-22-2009, 04:30 AM -
Servlet code change
By joeyxaza in forum Java ServletReplies: 0Last Post: 02-20-2009, 05:15 PM
Bookmarks