Results 1 to 15 of 15
  1. #1
    javajames is offline Member
    Join Date
    May 2011
    Posts
    32
    Rep Power
    0

    Default compile java in school

    im in school and i want to compile, all i have to work with is cmd. I need to be ableto set the path to the JDK thingy, so that i can use javac, thanks

  2. #2
    Dark's Avatar
    Dark is offline Senior Member
    Join Date
    Apr 2011
    Location
    Camp Lejuene, North Carolina
    Posts
    643
    Rep Power
    4

    Default

    Ok, this doesn't tell us much. Are you trying to figure out how to set the path? Also a lot of things depend on the school's security. You can lock quite a bit down with windows to the point where you cant even access files unless the program is authorized previously.

    I don't know how secure your school is, but have you taken a look at the capabilities of your machine? I assume its a network with student network access that allows you to log into any computer on the network?
    • Use [code][/code] tags when posting code. That way people don't want to stab their eyes out when trying to help you.
    • +Rep people for helpful posts.

  3. #3
    sunde887's Avatar
    sunde887 is offline Moderator
    Join Date
    Jan 2011
    Location
    Richmond, Virginia
    Posts
    3,069
    Blog Entries
    3
    Rep Power
    8

    Default

    Try opening cmd and typing javac, to see if the compiler is installed and the path is set. If it isn't you may not be able to do this unless they have very relaxed security. If it spits out some information you can try moving to the directory where the java file is located and typing
    Java Code:
    javac -cp . FileName.java

  4. #4
    JosAH's Avatar
    JosAH is online now Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,519
    Blog Entries
    7
    Rep Power
    20

    Default

    Quote Originally Posted by javajames View Post
    im in school and i want to compile, all i have to work with is cmd. I need to be ableto set the path to the JDK thingy, so that i can use javac, thanks
    Isn't there a TA that can do that for you? Normally those school computers aren't completely unsupervised. And, above all, this is not a Java question, it is an ordinary computer handling question (a bit of reading of the user manual should tell you how to do it).

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  5. #5
    Dark's Avatar
    Dark is offline Senior Member
    Join Date
    Apr 2011
    Location
    Camp Lejuene, North Carolina
    Posts
    643
    Rep Power
    4

    Default

    Like JosAH stated, if its school related in any way I'm sure your school wouldn't be against helping a student further their learning experience.
    • Use [code][/code] tags when posting code. That way people don't want to stab their eyes out when trying to help you.
    • +Rep people for helpful posts.

  6. #6
    javajames is offline Member
    Join Date
    May 2011
    Posts
    32
    Rep Power
    0

    Default

    javac -version reveals a lack of javac, however, all windows computers come with javac, you just need to set the path to /x/x/xx/x/jdk/x/x/x, the security on our schools computers is minimal, so i seriously doubt they would think to block that kind of thing (i can use cmd anyway)

  7. #7
    roja.raou Guest

    Default

    .java and it should compile and to run it you would just use java file.class

  8. #8
    javajames is offline Member
    Join Date
    May 2011
    Posts
    32
    Rep Power
    0

    Default

    nope, java only reads class files, i have no way of writing to class files, thats the point, i write my code and then i cannot compile it

  9. #9
    Dark's Avatar
    Dark is offline Senior Member
    Join Date
    Apr 2011
    Location
    Camp Lejuene, North Carolina
    Posts
    643
    Rep Power
    4

    Default

    Have you googled any tutorials on how to set up your JDK with the cmd prompt?
    • Use [code][/code] tags when posting code. That way people don't want to stab their eyes out when trying to help you.
    • +Rep people for helpful posts.

  10. #10
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    12,006
    Rep Power
    20

    Default

    Quote Originally Posted by javajames View Post
    javac -version reveals a lack of javac, however, all windows computers come with javac, you just need to set the path to /x/x/xx/x/jdk/x/x/x, the security on our schools computers is minimal, so i seriously doubt they would think to block that kind of thing (i can use cmd anyway)
    I assume you mean by this that all the Windows computers at your school come with it...:)

    Anyway, set your PATH to include the jdk/bin directory. As you have already said. Why is that a problem?

  11. #11
    jayragz is offline Member
    Join Date
    Apr 2011
    Posts
    35
    Rep Power
    0

    Default

    Right-click on My Computer on your desktop and choose Properties
    > Advanced
    >Click on Advanced Tab
    >Click on Environmental Variables Settings button
    In Windows you will see the PATH variable in the bottom of the window in an area called
    "System variables". Highlight the "path" variable and click the edit button.

    Add the following path: C:\Program Files\Java\jdk1.6.0_03\bin (but confirm if jdk is actually in this location)

    go to cmd and type javac -version.
    see if it brings up the version of jdk you are running.

    Hope that helps.

  12. #12
    javajames is offline Member
    Join Date
    May 2011
    Posts
    32
    Rep Power
    0

    Default

    i have to be able to set the path, from cmd, as that is the only administrative tool available at our school

  13. #13
    KevinWorkman's Avatar
    KevinWorkman is offline Crazy Cat Lady
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    3,958
    Rep Power
    8

    Default

    Another option is to google something like "online java compiler". Or you could install Java on a thumb drive.
    How to Ask Questions the Smart Way
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

  14. #14
    JosAH's Avatar
    JosAH is online now Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,519
    Blog Entries
    7
    Rep Power
    20

    Default

    Quote Originally Posted by javajames View Post
    i have to be able to set the path, from cmd, as that is the only administrative tool available at our school
    Will a .bat file do the job? You have to run it every time you want to use that computer or (re)start the cmd program.

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  15. #15
    javajames is offline Member
    Join Date
    May 2011
    Posts
    32
    Rep Power
    0

Similar Threads

  1. .java won't compile
    By paul21 in forum New To Java
    Replies: 4
    Last Post: 03-30-2010, 06:58 AM
  2. School project: network program via java any ideas?
    By Sernomicus in forum New To Java
    Replies: 2
    Last Post: 12-07-2009, 03:46 PM
  3. intro to java problem for school
    By thr33 in forum New To Java
    Replies: 1
    Last Post: 10-16-2009, 01:19 AM
  4. Taking Java In School Need Help
    By xEuPhOrIcSx in forum New To Java
    Replies: 7
    Last Post: 02-04-2008, 08:02 AM
  5. Help with Java Compile File
    By baltimore in forum New To Java
    Replies: 1
    Last Post: 08-06-2007, 07:48 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •