Results 1 to 5 of 5
Thread: deploying java program
- 01-16-2012, 01:46 AM #1
Senior Member
- Join Date
- Feb 2011
- Posts
- 235
- Rep Power
- 3
deploying java program
how do i deploy a java program? it doesn't seem to load anything. here is my code:
<APPLET CODE="test.class" alt="alt" WIDTH="400" HEIGHT="200">
</APPLET>
i have the index.html in a folder, as well as the test.class. in my java program, i have this:
public static void main(String[] args) {
System.out.println("hello!");
}
thanks.
-
Re: deploying java program
Please read the applet tutorials before trying to this as your post only demonstrates that you haven't done this yet. There you'll see that applets don't even have a main method but instead have init() among other things.
- 01-16-2012, 02:19 AM #3
Moderator
- Join Date
- Feb 2009
- Location
- New Zealand
- Posts
- 4,561
- Rep Power
- 11
Re: deploying java program
Java programs that are designed to be run within a web browser (called "applets") are a special type of program - and what you have written isn't one.
To make your program run you compile and run it from the command line. Go to whereever the .java file is and try:
The first line compiles and the second runs the program.Java Code:javac -cp . test.java java -cp . test
-----
The class (and source .java file) should be renamed to start with a capital letter - Test and Test.java - in order to follow Java coding conventions.
There is a good page on how to get started with Java in Oracle's Tutorial.
- 01-16-2012, 06:27 PM #4
Senior Member
- Join Date
- Feb 2011
- Posts
- 235
- Rep Power
- 3
Re: deploying java program
why would i have problems running a java applet (such as this: http://docs.oracle.com/javase/tutori...ppletPage.html) in firefox? it just shows that its loading. it works in IE for me.
- 01-16-2012, 08:24 PM #5
Similar Threads
-
Deploying Java Desktop application with database (MySQL, ORACLE, other...)
By IndioDoido in forum New To JavaReplies: 9Last Post: 01-17-2012, 08:31 AM -
Re: Deploying web application from Java classes
By Joel in forum New To JavaReplies: 23Last Post: 06-15-2011, 05:40 PM -
deploying Java Desktop application with MySql database
By lyjen in forum New To JavaReplies: 3Last Post: 10-28-2010, 02:42 PM -
Deploying java applications.
By J-Live in forum New To JavaReplies: 7Last Post: 11-24-2008, 07:08 AM -
Deploying a java application on an web or appp server.
By CharanZ in forum Advanced JavaReplies: 1Last Post: 10-29-2008, 10:45 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks