Win a copy of Java 9 Modularity: Patterns and Practices for Developing Maintainable Applications this week in the Java 9 forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

EXECUTABLE FILE FOR APPLICATION  RSS feed

 
Jessie Chapman
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm trying to attach java applets to a database but I came across a security issue, so now I want to create applications and connect them to a database.
When you create an applet it creates its own html file, you click the html file and it runs, basically I won't to do the same for an application.
So after all that gibberish how do you create an execution file for application? Is it simple?
 
Tim Holloway
Bartender
Posts: 18774
74
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
From a command prompt:
C:\> java classname
Where "classname" is the (fully-qualified) class name of the main class of the application - the one that has a definition of "public static void (String[] args)" - in it.
"classname" is the Java class name, NOT the class file name, so "com\javaranch\MyApp.class" is not correct - it should be "com.javaranch.MyApp" assuming you have a "package com.javaranch;" statement in the class source code.
You may also need to set a classpath. The current directory is only considered as part of the classpath if it has been set in a classpath definition (for example, by using the option "-classpath ." in the java command.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!