It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
I need some tips on creating a Java application. A few words about the application: people in the company will log in with a pwd; customised access types; possibility to perform changes in a remote database from a host within the network.
This is probably a very simple program. At first I don't care for security matters, that can be optimised in time. I just don't know how to start.
So far I've played with some algorithms (I like algorithms), connected an applet to a database and done a few select/updates, a couple of swings.
Even something that sounds like detailed chapter titles that I can investigate can prove useful, as I'm not sure what to look for when I want to create an application that can be distributed in a network.
Based on the previous:
What do I need to create? An applet, a swing, etc? Should it be an .exe and how is that done roughly?
Thanks for any tips.
I hear the application should come with an installation kit? What will that install - probably the JRE after checking whether it's installed on the client PC? What else?
Other tips that I should know for starters?
I'm not worried about algorithms or class names in the context of a user action (a select/update,etc)- I can find those in libraries. I'm interested in how to actually create a basic application that can be sent to users all over the company (methodology/practices/trainings), that they can run and see on their screen the result of a simple select, let's say. Any pointers/good references - as there are a lot of sites out there and not all are good. Thank you!
For Desktop Applications with a GUI and Database interaction etc. you should consider the use of a Rich Client Framework like Netbeans Platform or Eclipse RPC. This will certainly make a few things way easier, for example deploying the application, creating installers or multiple windows with docking capabilities.
By the way
At first I don't care for security matters
is generally a very, very bad idea...
Are you trying to launch the application from a web link? Then what you're looking for is "JNLP" or "Java Web Start".
https://en.wikipedia.org/wiki/Java_Web_Start
There are ways to set up user perms as part of the launch, and it will provision and deploy code and updates if necessary.
Good luck!
Related
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
I asked this the other day but it was closed, probably because I have a tendency to ramble so I'll get straight to the question.
I've written programs before so I'm not looking for an introduction to programming.
I was wondering if anyone had a good site/article/book that they think would be a good introduction to designing a server application.
The server will be a linux based amazon ec2 server with apache. I would prefer to use python, I know Java as well though if you think that would be a better programming language for server technology. It will be accessed over the internet via a web browser.
Again, does anyone know of a good site/article/book that they think would be a good introduction to designing a server application?
**Edit
The end application will be for use with a web browser to access via ajax to return information from a database/maintain a database and add/delete files from the server. Right now though I'm just looking to write a simple app that will take an ajax call, do something simple with it, and return the manipulated data.
**Edit
For starters I would like to just integrate with a static HTML page that uses javascript to ajax and update the HTML. Later I'll move onto creating the pages dynamically based on database information and templates with ajax calls to have the server update a database when I get more comfortable.
**Final Edit
Ok, for all the people who voted to close this. Where in your mind is "where is a good place to start learning to write a server application" not a straightforward or vague question? Seriously it isn't vague or unanswerable. The only way it would be overly broad is if you assume that when I ask about learning how to write a server application you are assuming that I already have a working knowledge of how server applications work and just left out what should be assumed to your elite hacker mind as given. To summarize, you had to learn about server application theory somewhere. All I'm asking is where (outside of school) and how can I learn the same thing.
Outside of those guys thank you all for providing the information I was looking for. It changed my thinking about how applications run on servers and gave me some insights.
I think you should clarify exactly what you want to build first. Java and Python both have their own strengths and weaknesses for development and execution - they also have a multitude of libraries and frameworks that you can use. For example, in Python you could build web applications off of Tornado, Twisted, Pyramid, Django, and countless others. Java has numerous
Apache has been on a general decline from having a place in webapp stacks. It's a great general web server, but it's totally unneeded with the technologies you're mentioning. If you're deploying Java, you can use Tomcat and Jetty. If you're deploying Python, you can use something small like nginx to proxy http to the python app or use the uwsgi protocol. Most people I know have something like nginx or varnish on port 80, and just proxy everything back to python/java/php/apache/etc.
Once you explain exactly what you want to learn how to build , you'll likely have better answsers.
What are you looking for exactly. What will contains your server and what will the main application ? just web ? webservices ? cron ?
you could look at google app engine
These days site like Udacity Coursera etc are getting popular and are doing wonderful job. I am particularly attending a course CS253. http://www.udacity.com/view#Course/cs253/CourseRev/apr2012/Unit/20006/Nugget/51001
I think thats the best resource.
If you already know Java, look toward a Servlet application. It is a rather easy way to get introduced to HTTP servers, and Tomcat does enough of the heavy lifting to allow you to focus on the actual handling of requests in a manner that isn't heavily concerned with socket handling, protocol deciphering, etc.
If the low level server details are what you are after, Java is still a good choice, just look at a client / server socket tutorial, and start adding features / code structure.
Good luck, and have fun
in fact you wanna know how servers work. have you ever tried to google "how a server works" ?
After requests and responses theory, you have to learn differents kind of server (web, ftp, smtp etc.)
Finally, python provides networks modules
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
I'm currently developing a programming contest website, and want to implement support for submitting code and running it on the website. After quite a bit of googling, I still haven't found any "guides" for this.
Does anyone know of a website(or other sources) that contains some basic guidelines or ground rules for this?
Appreciate all replies.
PS: If anyone wonders about all the programming language tags, I'm planning on supporting at least these languages.
Careful -- if you're finding it difficult to break this project down into some smaller, more tactical problems, I'd strongly suggest that you make no attempt whatsoever to actually run anyone else's code on your site. In terms of creating the site itself, I'd suggest leveraging pre-built components or services where possible -- Wordpress, GitHub, etc.
Once you've got the submissions, you'll want to have a way to run them safely. For all practical purposes, this means that you should assume that any machine you run someone else's code on might spontaneously burst into flames. While it's true that some of these languages have features you should be able to use to run code in a "sandbox", you're probably not going to be expert enough in all these languages to be able to properly secure all of them.
It seems that something like Amazon's EC2 might be helpful -- spin up a VM when you need to run a submission, and throw it away when you're done. They've got some pre-configured images that would probably be well-suited to running this code, and if something gets buggered up because of buggy or malicious code, you don't mind too much because you're just going to throw it away when you're done.
There is a site that already does this, albeit for a particular purpose: scraping data.
https://scraperwiki.com/ - Unlike jsfiddle, scraperwiki executes server-side code. As far as I can gather, they likely sandbox the environment via amazon instances. Not sure that their code can be entirely audited and sanitized, given the variety of languages and scraping libraries they support.
I think most people are baffled as to how scraperwiki keeps hackers and spammers at bay from misusing their resources. They've been rather mum about it; either they've manually audited every bit of executed code, or hackers/spammers haven't caught onto them yet. Since the site has a specific function, they probably check data utilization to determine suspicious activity. ...but, one man's site scraping is another man's harassment and injection by get/post.
My hunch is that they'll never publicly spell out what their security audit process is like.
If you really had to do it, simplest mechanical way of doing this without virtualization is to use a variant of eval(). But, not all languages have that. Which brings you to option B, which is virtualization. Better people than I can explain how to regiment virtual machines to this effect, and will caution you properly on letting strangers abuse your resources. Instead, I'll share my PHP experience.
Some years back I've made a project that does code execution on the fly (on a local machine.) As you type, it takes the code via ajax and executes after each keystroke. Here's a video of its behavior: http://www.youtube.com/watch?v=Yfxrt2pc3pg.
Half a decade and 3 improvement prototypes later, I'm still not sure how I would responsibly lock this down as a common resource.
For Java it is quite simply:
You're have to create Servlet, for uploading source code into server (for
example, via POST request)
Use Java Compiler API to compile source code to bytecode ( tutorial )
Compiled bytecode you're might dynamically load via ClassLoader and launch it (also you're might configure SecurityManager)
And don't forget about MVC architecture :)
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 11 years ago.
I would like to give an executable jar file to my client and I have a code in it to expire after a certain time. But if the client uses some decompiler and reads the class file, he can modify and make the code to work Is there any way I can stop this from happening.
Can I use deleteOnExit() or some other technique ???
If you are so worried someone will crack your software, you'll need to use some kind of client/server architecture where your client can only log in to a webpage in your servers.
Any code can be cracked if there's someone who really wants too. Of course, most of the time its simply not worth it.
Best solution for this is PaaS (platform as a service)..
put your logic on a server as server-app and let client-app communicating with server-app through web-service or any other way .. this is the best real solution..
BTW: using obfuscation cannot protect your code.
Sorry, not possible in any kind of environment currently in use. If you are so worried about the client stealing your code, it might be good to reevaluate your relationship with him.
On the other hand, you could provide him with a gated VNC view of your software, whereby he can use it but where you remain in control of the environment.
In the past, I've used Zelix KlassMaster to perform obfuscation. It does a very good job, however, you have to spend time to configure it such that it works properly for your needs. If you use reflection, then you have to ensure that it doesn't obfuscate those class/method/property names, etc. One of its strong suits is that it will obfuscate strings as well.
All that being said, the end result is that your client will still have your code, alebit in a very difficult-to-understand format. However, if he truly has the time and effort, he can reverse engineer it.
A lot also depends on exactly what it is that you are trying to protect. If you are trying to protect the actual IP then obfuscation will help you out. If you are trying to protect licensing, then obfuscation just makes it a little more challenging for someone to figure out where your licencing module(s) are and how to circumvent them. In the latter case, I would then suggest that you use something like AspectJ to weave in licensing checks in several different classes just to make it more difficult to break. However that too is not fail-proof.
As others have already said, the only fool-proof system is to not give the client the code in the first place and change to a SAAS (Service as a software) solution.
What about using a modified classloader that is able to load your classes from an encrypted storage. As you do not directly expose the jar and the classes inside it might help but as all others said above - it won't be bulletproof.
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 12 years ago.
Hypothetically, could java be used to write a website instead of, say, asp.net. or php?
J2EE is an entire branch of Java made towards running Java as a web server. It includes making it easy to code for distributed servers, a messaging protocol and database interaction. It's extremely powerful, well written and stable and you'll find it's used by many large web sites.
It's also very different from just coding a simple single-purpose server. Some of the complication is up-front/built in, so there is a larger initial learning curve but you won't encounter many of the problems you would if you tried to do it on your own...
For instance, imagine the most complex server-side code you've written--what would it take to make it run distributed across 2 servers (So that either server may answer any request with the requests based on server load)? If it were written in proper J2EE it would just be editing a few config files.
Some would argue that this is what Java is mostly used for! Sarcasm aside check out the Wikipedia entry for Java Enterprise Edition for the summary and of course the official Oracle Java EE website for details.
Basically there is a whole host of mature server APIs and application servers from different vendors (including Open Source vendors) that implement those APIs. Server side Java is really a mini-industry with god knows how many companies, open source projects, conferences and the like.
If you are new to server side Java you coming in at a good time, you missed the dark days EJB 1.0 and 1.1 and now there is a rather useful, if a little heavyweight set of APIs on which to build your server side applications.
Yes, it is actually quite common.
I think so. It's the basis for JSP and Java Servlets.
Yes.You can use Tomcat web container or glass fish, JBoss,...
There is few frameworks, like Tapestry, JSF,...
If you encountered a .jsp extension for a page, it was definitely Java (.jsp = Java Server Pages). Of course you can generate plain HTML (or whatever you want) as well.
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 12 years ago.
I am new to Java and really impressed with it. I am interested in leveraging the latest java technology, however, not from an enterprise standpoint. I want to leverage the latest technology from a small business development point of view. I feel that the small mom and pop grocery store can enhance their operational effectiveness by using the new Java technology, obviously not on an enterprise scale. If my thinking here is incorrect and if there is a school of thought that the current Java technologies is not designed for the small business person (which consist of 80% of the businesses today), I can accept that. If not, then
what Java development framework, tools, skills, etc; do you recommend as a minimum for small business development?
Jerry McLeod
Frameworks, tools, languages and skills are all designed for tasks, therefore it's relatively meaningless to talk about the organisation instead of about the tasks which an organisation might wish to perform. A kid in garage could use every piece of Java Enterprise software available just as well as a Fortune 500 company could choose to use PHP.
So in essence, your question doesn't make a lot of sense without reference to what you might want to do with it. It's true that a small business is unlikely to want many of the large-scale features that Java can offer, but it doesn't mean they can't use them if it's appropriate for the task at hand!
Tools should fit the task at hand; the task at hand should not be defined so as to use the latest tools.
What tasks need to be done for small businesses? If I were just working on a website, I'd probably use PHP. But I have no idea what you're looking for.
Core framework for Java (Web) Development is Spring and Apache Commons libraries. And same for database access is hibernate. As development tools I would suggest SpringSource Tool Suite and for web application deployment Apache Tomcat. And my favorite build tool is Apache Maven.
But all this can variate what you would like to develop.
you should watch out with getting flooded in al sorts of skills, frameworks, tools you start learning. That might become a huge confusion. Basically if you want me to spam with words, I'd say you definately need
J2EE, JAAS, Spring and hibernate.
As a person I would recommend you to learn OO programming first if you are not familiar with java. I think there is little use in these tools if you don't know how to use java. I would start with reading Design patterns - Head first, and Effective java, to explore what OO is really all about. You can't get into business development (how small it is even...) except if you do it together with someone who knows what he does.
but that's just my thoughts
First of all why would Mom&Pops care if it's Java, C++ or ASM? Second of all you didn't really tell us what you want to achieve. Do you want to create web applications or standalone apps? For the latter you just need Java SE+any framework needed to get a certain job done. If you want to do webapps then it gets a bit hectic. Some people already mentioned Java EE, Spring, Hibernate etc. but there's also EJB (well it's part of the Java EE), Struts and so on.
Some might say java isn't well suited for small web apps, well I can't agree with that. JSF+Spring+Hibernate and you can get a simple usefull webapp up and running in 2-4weeks.