Click here to Skip to main content
15,884,628 members
Home / Discussions / Java
   

Java

 
AnswerRe: How to package Jar by copying ONLY USED classes from onother jar ?! Pin
jschell23-Oct-22 11:30
jschell23-Oct-22 11:30 
QuestionJava program project using netbeans Pin
Member 1576471312-Sep-22 0:20
Member 1576471312-Sep-22 0:20 
AnswerRe: Java program project using netbeans Pin
Dave Kreskowiak12-Sep-22 1:21
mveDave Kreskowiak12-Sep-22 1:21 
GeneralRe: Java program project using netbeans Pin
Gerry Schmitz12-Sep-22 6:27
mveGerry Schmitz12-Sep-22 6:27 
QuestionSocket connection offline vs busy Pin
JohnCodding9-Aug-22 20:26
JohnCodding9-Aug-22 20:26 
AnswerRe: Socket connection offline vs busy Pin
Richard MacCutchan9-Aug-22 21:03
mveRichard MacCutchan9-Aug-22 21:03 
GeneralRe: Socket connection offline vs busy Pin
JohnCodding9-Aug-22 21:10
JohnCodding9-Aug-22 21:10 
GeneralRe: Socket connection offline vs busy Pin
Richard MacCutchan9-Aug-22 21:12
mveRichard MacCutchan9-Aug-22 21:12 
GeneralRe: Socket connection offline vs busy Pin
Richard MacCutchan9-Aug-22 21:17
mveRichard MacCutchan9-Aug-22 21:17 
GeneralRe: Socket connection offline vs busy Pin
JohnCodding9-Aug-22 21:36
JohnCodding9-Aug-22 21:36 
GeneralRe: Socket connection offline vs busy Pin
Richard MacCutchan9-Aug-22 21:45
mveRichard MacCutchan9-Aug-22 21:45 
AnswerRe: Socket connection offline vs busy Pin
Gerry Schmitz10-Aug-22 4:13
mveGerry Schmitz10-Aug-22 4:13 
AnswerRe: Socket connection offline vs busy Pin
englebart12-Oct-22 15:20
professionalenglebart12-Oct-22 15:20 
QuestionUser Path not working until computer restart Pin
Valentinor13-Jul-22 9:27
Valentinor13-Jul-22 9:27 
In my app I'm using JNI, and because of that I have to add into User/System Path the location to jvm.dll from JRE\bin\server. To add a variable in User Path it doesn't require administrator rights, so I'm taking this approach. To add it I'm using REG ADD from CMD with the following functions. The problem that I have is that after I'm adding the variable into Path, the software still doesn't see it and returns the error "jvm.dll not found", but if I restart the computer, then it runs fine and sees the variable. Also after I'm adding it, if I manually go into User Path and double click to edit the variable, and simply press enter without changing anything, then it doesn't require the restart. Does it have something to do with the code/way I'm adding the variable? What should I do to get past this and to get it working without the user/client having to restart the computer before it is working?

Function to run CMD:
C++
std::string executeCMD(const char* cmd) {
	std::string result;
	std::array<char, 128> buffer;
	std::unique_ptr<FILE, decltype(&_pclose)> pipe(_popen(cmd, "r"), _pclose);
	if (!pipe) {
		return "ErrorCMD";
	}
	while (fgets(buffer.data(), buffer.size(), pipe.get()) != nullptr) {
		result += buffer.data();
	}
	return result;
}


Use of the function:
C++
resultCMD.insert(0, "reg add \"HKEY_CURRENT_USER\\Environment\" /v PATH /t REG_EXPAND_SZ /d \"");
resultCMD.append("\" /f");
executeCMD(resultCMD.c_str());


resultCMD is a std::string which contains the values that were in Path and also the value that I'm adding under the following format with "C:\Program Files\Eclipse Adoptium\jre-18.0.1.10-hotspot\bin\server" being added after I use the function from above:
C:\Program Files\Eclipse Adoptium\jre-18.0.1.10-hotspot\bin\server;D:\Program Files (x86)\VMware\VMware Player\bin\;D:\Program Files\Python\Python310\Scripts\;D:\Program Files\Python\Python310\;C:\Windows\system32;C:\Windows; ...and the rest of the variables, this was as an example, after each variable they have a ;
AnswerRe: User Path not working until computer restart Pin
Valentinor13-Jul-22 23:28
Valentinor13-Jul-22 23:28 
AnswerRe: User Path not working until computer restart Pin
englebart12-Oct-22 15:26
professionalenglebart12-Oct-22 15:26 
QuestionDistribute software that uses Java Pin
Valentinor7-Jul-22 9:28
Valentinor7-Jul-22 9:28 
AnswerRe: Distribute software that uses Java Pin
Gerry Schmitz7-Jul-22 19:46
mveGerry Schmitz7-Jul-22 19:46 
AnswerRe: Distribute software that uses Java Pin
Dave Kreskowiak8-Jul-22 11:30
mveDave Kreskowiak8-Jul-22 11:30 
GeneralRe: Distribute software that uses Java Pin
Valentinor8-Jul-22 19:32
Valentinor8-Jul-22 19:32 
GeneralRe: Distribute software that uses Java Pin
Dave Kreskowiak8-Jul-22 19:40
mveDave Kreskowiak8-Jul-22 19:40 
GeneralRe: Distribute software that uses Java Pin
Valentinor8-Jul-22 21:51
Valentinor8-Jul-22 21:51 
GeneralRe: Distribute software that uses Java Pin
Dave Kreskowiak9-Jul-22 5:43
mveDave Kreskowiak9-Jul-22 5:43 
Questionsolve the error Pin
Member 156672428-Jun-22 21:02
Member 156672428-Jun-22 21:02 
RantRe: solve the error Pin
Richard Deeming8-Jun-22 21:19
mveRichard Deeming8-Jun-22 21:19 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.