|
Member 14154627 wrote: I'd like to create a program that has an icon I can put on my Windows desktop and click on it to run the program.
Ok.
Member 14154627 wrote: Is this possible with JAVA?
I doubt it.
Mainly because of the way windows locks down installing anything on windows. But easy enough to try.
1. Create java app
2. Have it create folder in "Program Files"
3. Have it create a shortcut and put it into desktop folder. The shortcut is just a simple file and you do not even need to create one, just copy one from somewhere else.
4. Run it as ADMIN (very important.)
If that works then yes. If not then you would probably need to do some JNI work which isn't really Java.
Member 14154627 wrote: The only way I know to run a JAVA program is java -cp . programname
You can package a java jar such that it is 'clickable'.
HOWEVER, to do any of the above java must already be on the windows box. At least at one point java was coming with windows but I am not sure about that any more. Installing java itself cannot be done within java (chicken and egg.)
|
|
|
|
|
How i can integrate my developed stemmer with Terrier Information retrieval system on window 10
|
|
|
|
|
|
Is the code from a Servlet "safe" from being viewed by an user? To make this more clear, let say that in a Servlet, you'll add a connection to a database, and because of this, from Connection object you can get the IP, port, user, password, kinda all you need to access the DB at a certain level, which is bad.
So, that being said, can a user see the code from a Servlet? Or the Servlet is just being run on the server side, and only sending out a "result" to client side, and so, the user is unable to see the actual code of a Servlet?
modified 13-Feb-19 7:48am.
|
|
|
|
|
Quote: A servlet is similar to a proprietary server extension, except that it runs inside a Java Virtual Machine (JVM) on the server . So the client user cannot access it. For full details see Java Servlet Technology[^].
|
|
|
|
|
|
Servlets run on the server. Unless there's something wrong with your server's configuration, the Java code will never leave the server.
Java Servlets - A Tutorial[^]
Also, your database server is not supposed to be accessible from the outside world. The firewall should be configured to prevent access from machines other than your server. So even if someone did manage to get the connection details, they shouldn't be able to connect to your database.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
What I said was more of an example, I haven't reached the point of using the DB yet.
Quote: Also, your database server is not supposed to be accessible from the outside world. The firewall should be configured to prevent access from machines other than your server. So even if someone did manage to get the connection details, they shouldn't be able to connect to your database.
Also this will help me when I get there. Thanks!
|
|
|
|
|
Should note however that doing that is dependent on the network setup and NOT on code.
|
|
|
|
|
Yeah, I know how to do that, it just didn't crossed my mind until now, as I said, didn't made any projects that used DB so far, but really soon I'll need it. Thanks anyway!
|
|
|
|
|
I have to make some sort of app where you need to put grades and stats for students so I have a problem here I need to have at least 5 classes and I don't know how to organize it.
Interface will be in swing and we need to use all basic OOP techniques. I need help with what classes would you make if you were to make this project. ( first time making a project..)
|
|
|
|
|
|
Member 14133670 wrote: Interface will be in swing
Presumably a class assignment.
Just noting that you probably should put more effort into the back end and spend as little time on this swing part as possible. Any use of swing is going to be very limited in the business space.
Member 14133670 wrote: I need help with what classes
I think you should do this yourself. It is like using a hammer for the first time - watching a video of someone using a hammer is not going to help you when you swing the first time. Even though you are going to hit your thumb you just need to do it.
|
|
|
|
|
Hello. Please what can I do to continue coding java ide when after running it says code too large. the codes are well above 1000 and I still need to code more.
|
|
|
|
|
Please provide some more details, your question is not clear.
|
|
|
|
|
The program is to create an excel sheet after some computations and tabulations through a designed interface.The codes is about 6000. when I continue to add more codes for further task, it displayed an error message that, code too large, after running it. Is their any way to make it run after more codes. Alternatively can you show me how to access text field from a different class to minimize the codes. thank you
|
|
|
|
|
I am sorry, but that does not make anything clearer. What do you mean by "The codes is about 6000", and where does the error message occur, and what is the exact text?
|
|
|
|
|
Ok. Can you assist me on how to access textfield from a different class in the same package (i.e to reference a JTextField from a diffrent class). Thank you.
|
|
|
|
|
From what I can understand, you have a class or method that is too long for the generated code to be able to run. You need to break it down into smaller pieces.
Referencing any item from a different class just requires a method that provides access to the item in the class.
|
|
|
|
|
Java does not allow a 'method' to be more than 64k byte codes (internal java compiled representation.)
So you have a method that is too large and you MUST break it into smaller methods. That would be the only possible solution.
In some cases if you are attempting to initialize static data, for example an array, list, etc, as a local variable you will get this error also because initialization is handled by the java compilers by creating a hidden method. Solution for that is to change how the initialization is done such as loading the data from a file.
|
|
|
|
|
Without entering in deep functionality of Servlets, what is it's use? To run some code, and at the end to redirect the user to another web page?
I'm asking because maybe there are some situations where you don't need to redirect the user to another page after the Java code from servlet is done. In this case, is there a way to stop the servlet from redirecting the user to another page? Even if you don't add a redirect or forward to the servlet, it will still redirect the user to it's map url.
|
|
|
|
|
|
Actually I've done that too, that is why I added this in my question, and why I didn't asked only it's purpose:
Quote: is there a way to stop the servlet from redirecting the user to another page? Even if you don't add a redirect or forward to the servlet, it will still redirect the user to it's map url.
|
|
|
|
|
A servlet is merely a program: it does what the code tells it to do. If you have a specific code problem then I would suggest opening a question with the details.
|
|
|
|
|
A HTTP servlet services HTTP requests, and it must finish the processing by sending a valid HTTP response to the client. The response doesn't need to be a redirect.
|
|
|
|